/*************************************************************************** rlstring.h - description ------------------- begin : Wed Jan 02 2008 copyright : (C) Lehrig Software Enigineering email : lehrig@t-online.de ***************************************************************************/ /*************************************************************************** * * * This library is free software; you can redistribute it and/or modify * * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as * * published by the Free Software Foundation * * * ***************************************************************************/ #ifndef _RL_STRING_H_ #define _RL_STRING_H_ #include #include "rldefine.h" extern const char rlCRLF[]; /*!
class for a simple ANSI-C like string.
*/ class rlString { public: /*!
  construct the string
  
*/ rlString(const char *text=""); rlString(rlString &text); rlString(rlString *text); rlString(const rlString &text); /*!
  destruct the string
  
*/ virtual ~rlString(); rlString& operator=(const char *s2); rlString& operator=(rlString &s2); rlString& operator+(const char *s2); rlString& operator+(rlString &s2); rlString& operator+=(const char *s2); rlString& operator+=(rlString &s2); int operator==(const char *s2); int operator==(rlString &s2); int operator==(const rlString &s2); int operator!=(const char *s2); int operator!=(rlString &s2); /*!
  get the text
  
*/ char *text(); char *text() const; /*!
  set the text
  
*/ int setText(const char *text); /*!
  printf the text
  
*/ int printf(const char *format, ...); /*!
  copy text
  
*/ int strcpy(const char *text); /*!
  append text
  
*/ int cat(const char *text); /*!
  converst string to upper case
  
*/ int upper(); /*!
  converst string to upper case
  
*/ int lower(); /*!
  test if string starts with startstr
  
*/ int startsWith(const char *startstr); /*!
  case insensitive string compare
  
*/ int strnocasecmp(const char *other); /*!
  case insensitive string compare starting n characters
  
*/ int strnnocasecmp(const char *other, int n); /*!
  strstr()
  
*/ char *strstr(const char *substring); /*!
  strchr()
  
*/ char *strchr(int c); /*!
  strchr()
  
*/ char *strrchr(int c); /*!
  Remove quotas around a string.
  This might be usefull together with CSV files.
  
*/ int removeQuotas(char c='"'); /*!
  Remove "\n" at end of string.
  
*/ int removeNewline(); /*!
  Read string from file.
  
*/ int read(const char *filename); /*!
  Write string to file.
  
*/ int write(const char *filename); /*!
  convert to platform independent filename
  
*/ const char *toFilename(); /*!
  convert to platform independent directoryname
  
*/ const char *toDirname(); private: char *txt; char *tmp; }; #endif