rllib  1
rlstring.h
Go to the documentation of this file.
1 /***************************************************************************
2  rlstring.h - description
3  -------------------
4  begin : Wed Jan 02 2008
5  copyright : (C) Lehrig Software Enigineering
6  email : lehrig@t-online.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This library is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
13  * published by the Free Software Foundation *
14  * *
15  ***************************************************************************/
16 #ifndef _RL_STRING_H_
17 #define _RL_STRING_H_
18 
19 #include <string.h>
20 #include "rldefine.h"
21 
22 extern const char rlCRLF[];
23 
27 class rlString
28 {
29 public:
33  rlString(const char *text="");
36  rlString(const rlString &text);
37 
41  virtual ~rlString();
42 
43  rlString& operator=(const char *s2);
45 
46  rlString& operator+(const char *s2);
48 
49  rlString& operator+=(const char *s2);
51 
52  int operator==(const char *s2);
53  int operator==(rlString &s2);
54  int operator==(const rlString &s2);
55 
56  int operator!=(const char *s2);
57  int operator!=(rlString &s2);
58 
62  char *text();
63  char *text() const;
64 
68  int setText(const char *text);
69 
73  int printf(const char *format, ...);
74 
78  int strcpy(const char *text);
79 
83  int cat(const char *text);
84 
88  int upper();
89 
93  int lower();
94 
98  int startsWith(const char *startstr);
99 
103  int strnocasecmp(const char *other);
104 
108  int strnnocasecmp(const char *other, int n);
109 
113  char *strstr(const char *substring);
114 
118  char *strchr(int c);
119 
123  char *strrchr(int c);
124 
129  int removeQuotas(char c='"');
130 
134  int removeNewline();
135 
139  int read(const char *filename);
140 
144  int write(const char *filename);
145 
149  const char *toFilename();
150 
154  const char *toDirname();
155 
156 private:
157  char *txt;
158  char *tmp;
159 };
160 
161 #endif
char * tmp
Definition: rlstring.h:158
int read(const char *filename)
Definition: rlstring.cpp:279
const char * toFilename()
Definition: rlstring.cpp:308
int removeQuotas(char c='"')
Definition: rlstring.cpp:233
int startsWith(const char *startstr)
Definition: rlstring.cpp:198
int operator!=(const char *s2)
Definition: rlstring.cpp:114
int lower()
Definition: rlstring.cpp:193
int cat(const char *text)
Definition: rlstring.cpp:171
char * strstr(const char *substring)
Definition: rlstring.cpp:182
rlString & operator=(const char *s2)
Definition: rlstring.cpp:60
char * text()
Definition: rlstring.cpp:126
const char * toDirname()
Definition: rlstring.cpp:353
const char rlCRLF[]
Definition: rlstring.cpp:23
int strcpy(const char *text)
Definition: rlstring.cpp:161
int setText(const char *text)
Definition: rlstring.cpp:136
int removeNewline()
Definition: rlstring.cpp:271
int upper()
Definition: rlstring.cpp:188
char * strrchr(int c)
Definition: rlstring.cpp:228
int strnnocasecmp(const char *other, int n)
Definition: rlstring.cpp:213
int strnocasecmp(const char *other)
Definition: rlstring.cpp:203
int printf(const char *format,...)
Definition: rlstring.cpp:145
virtual ~rlString()
Definition: rlstring.cpp:54
int operator==(const char *s2)
Definition: rlstring.cpp:96
rlString & operator+(const char *s2)
Definition: rlstring.cpp:72
int write(const char *filename)
Definition: rlstring.cpp:297
char * txt
Definition: rlstring.h:157
rlString & operator+=(const char *s2)
Definition: rlstring.cpp:84
char * strchr(int c)
Definition: rlstring.cpp:223
rlString(const char *text="")
Definition: rlstring.cpp:25