HistoDisplay.h File Reference

#include <TGFrame.h>
#include "TTimer.h"

Go to the source code of this file.

Classes

class  HistoDisplay
class  HistoDisplayUpdateTimer
class  HistoDisplaySlideTimer

Functions

char * getword (char *str, const char commentchar= '#')
char * strdelete (char *str, const char *del)
char * strstrn (const char *s, const char *k)

Function Documentation

char* getword ( char *  str,
const char  commentchar = '#' 
)

Definition at line 1805 of file HistoDisplay.cxx.

Referenced by HistoDisplay::MakeConsumerInfo().

01806 {
01807   //cout << " In getword " << endl;
01808 
01809   char *word = 0;
01810 
01811   if ( str && ( strlen( str ) > 0 ) ) {
01812     char *begin = str;
01813     while( isspace( *begin ) && ( *begin != '\0' ) ) begin++;
01814 
01815     //if ( *begin != '\0' ) {
01816     if ( ( *begin != '\0' ) &&
01817          ( *begin != commentchar ) ) {
01818 
01819       char *end = begin;
01820 
01821       //while( !isspace( *end ) ) end++;
01822 
01823       while( !isspace( *end ) ) {
01824         char *tmp = 0;
01825         if ( ( *end == '\"' ) && 
01826              ( tmp = const_cast<char*>(strchr( end + 1 , '\"' )) )  ) end = tmp;
01827         else end++;
01828       }
01829 
01830       char tmpchr = *end;
01831       *end = '\0';
01832  
01833       word = new char[ strlen( begin ) + 1 ];
01834       strcpy( word , begin );
01835 
01836       *end = tmpchr;
01837 
01838     } //if ( *begin != '\0' )
01839 
01840   } // if ( str && ( strlen( str ) > 0 ) )
01841 
01842   return word;
01843 
01844 }

char* strdelete ( char *  str,
const char *  del 
)

Definition at line 1847 of file HistoDisplay.cxx.

Referenced by HistoDisplay::MakeConsumerInfo().

01848 {
01849   //cout << " In strdelete " << endl;
01850 
01851   char *newword = 0;
01852 
01853   char *pos = 0;
01854   if ( ( pos = const_cast<char*>(strstr( str, del )) ) ) {
01855     newword = new char[ strlen( str ) - strlen( del ) + 1 ];
01856     if ( newword ) {
01857       char tmp = *pos;
01858       *pos = '\0';
01859 
01860       strcpy( newword, str );
01861 
01862       *pos = tmp;
01863 
01864       strcat( newword, pos + strlen( del ) );
01865 
01866     }//if ( newword )
01867   } //if ( pos = strstr( str, del ) )
01868 
01869   return newword;
01870 
01871 }

char* strstrn ( const char *  s,
const char *  k 
)

Definition at line 1875 of file HistoDisplay.cxx.

Referenced by HistoDisplay::ProcessMessage(), and HistoDisplay::SearchWarningErrorFolder().

01876 {
01877   const char *pk = k;
01878   const char *ps = 0;
01879 
01880   while ( *s != '\0' ) {
01881     if ( tolower( *s ) == tolower( *pk ) ) {
01882       if ( pk == k ) ps = s;
01883       pk++;
01884       if ( *pk == '\0' ) break;
01885     } //if ( tolower( *ps ) == tolower( *pk ) )
01886     else {
01887       pk = k;
01888       ps = 0;
01889     } //else //if ( tolower( *ps ) == tolower( *pk ) )
01890     s++;
01891   } //while ( *s != '\0' ) 
01892 
01893   return  (char*) ps;
01894 
01895 }


Generated on 16 Jan 2018 for loon by  doxygen 1.6.1