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

vdkstring.h

00001 /*
00002 * ===========================
00003 * VDK Visual Development Kit
00004 * Version 1.2.3
00005 * October 1998, August 2000
00006 * ===========================
00007 *
00008 * Copyright (C) 1998, Mario Motta
00009 * Developed by Mario Motta <mmotta@guest.net>
00010 *
00011 * This library is free software; you can redistribute it and/or
00012 * modify it under the terms of the GNU Library General Public
00013 * License as published by the Free Software Foundation; either
00014 * version 2 of the License, or (at your option) any later version.
00015 *
00016 * This library is distributed in the hope that it will be useful,
00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019 * Library General Public License for more details.
00020 *
00021 * You should have received a copy of the GNU Library General Public
00022 * License along with this library; if not, write to the Free Software
00023 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00024 * 02111-130
00025 */ 
00026 
00027 #ifndef VDKSTRING_H
00028 #define VDKSTRING_H
00029 
00030 #define MAXPRINTFLEN    65535   // max size for Sprintf and Concatf buffer
00031 #define INT_DATE                0               // for FormatDate
00032 #define ENG_DATE                1
00033 #define EUR_DATE                2
00034 
00035 struct STRING 
00036 {          
00037         char* s;              
00038         unsigned int ref ;    
00039 };
00040 
00045 class VDKString 
00046 {       
00047 protected:
00048         STRING* p;         
00049 public:
00056         VDKString();
00065         VDKString (const char*s);
00074         VDKString (const char& c);
00084         VDKString(const VDKString& s);
00085 
00096         VDKString& operator= (const VDKString& s);
00097 
00106         VDKString& operator= (const char* s);
00107 
00111 ~VDKString();
00116         operator char*() { return p->s; }
00117 
00121         int operator == (const VDKString& s) const ;
00125         int operator <( const VDKString& s) const ;
00129         int operator>(const VDKString& s)  const ;
00133         int operator <=(const VDKString& s) const ;
00137         int operator >=(const VDKString& s) const ;
00141         int operator !=(const VDKString& s) const ;
00150         VDKString& operator +=(const char* s);
00160         VDKString& operator +=(const VDKString& s);
00168         VDKString  operator + (const char* s) const;
00169         friend VDKString operator + (const char* s, const VDKString& vdks);
00174         VDKString  operator +(const VDKString& s) const;
00178         bool isNull() const;
00182         int size() const;
00186 char operator[](unsigned int ix) const;
00190 const char* c_str() const;
00197         VDKString& DelSelection(unsigned int begin, unsigned int len);
00202         VDKString& RTrim();
00207         VDKString& LTrim();
00212         VDKString& Trim();
00221         unsigned int CharCount(const char car) const;
00227         VDKString& UpperCase();
00232         VDKString& LowerCase();
00237         bool isEmpty() const;
00251         VDKString& Concatf(const char* format, ...);
00265         VDKString& Sprintf(const char* format, ...);
00278         VDKString& GetPart(unsigned int i, const char sep = '|');
00284         int GetFCharPos(const char car) const;
00290         int GetLCharPos(const char car) const;
00295         double StrtoDouble() const;
00300         int StrtoInt() const;
00307         VDKString& SubStr(unsigned int start, unsigned int len);
00313         VDKString& Cut(unsigned int len);
00320         VDKString& LPad(unsigned int len, const char car);
00327         VDKString& RPad(unsigned int len, const char car);
00338         VDKString& DoubleChar(const char car = '\'');
00359         VDKString& FormatDate(const char sep, int orig, int ret);
00360 };
00361 
00362 #endif
00363 
00364 
00365 
00366 

Generated on Sat Sep 3 12:10:19 2005 for vdk 2.4.0 by  doxygen 1.4.4