Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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 1803 of file HistoDisplay.cxx.

Referenced by HistoDisplay::MakeConsumerInfo().

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

char* strdelete char *  str,
const char *  del
 

Definition at line 1845 of file HistoDisplay.cxx.

Referenced by HistoDisplay::MakeConsumerInfo().

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

char* strstrn const char *  s,
const char *  k
 

Definition at line 1873 of file HistoDisplay.cxx.

References s().

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

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


Generated on Mon Feb 15 11:07:59 2010 for loon by  doxygen 1.3.9.1