00001 #ifndef REBECCA_STRINGPIMPL_H
00002 #define REBECCA_STRINGPIMPL_H
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 #include <rebecca/exports.h>
00029 #include <rebecca/Exceptions.h>
00030 
00031 
00032 #include <cstddef>
00033 
00034 
00035 
00036 
00037 #ifdef _WIN32
00038 #    pragma warning ( push )
00039 #    pragma warning( disable : 4290 )
00040 #endif
00041 
00042 
00043 
00044 namespace rebecca
00045 {
00046 
00047 namespace impl
00048 {
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058  
00059 class StringPrivate;
00060 
00082 class REBECCA_EXPORT StringPimpl
00083 {
00084     public:
00085 
00097         StringPimpl() 
00098             throw(Exception &);
00099 
00114         StringPimpl(const char * const stringPimpl) 
00115             throw(Exception &);
00116         
00129         const char *c_str() const 
00130             throw(Exception &);
00131 
00143         bool empty() const 
00144             throw(Exception &);
00145 
00156         StringPimpl(const StringPimpl& stringPimpl);
00157 
00168         StringPimpl &operator=(const StringPimpl &stringPimpl);
00169 
00178         virtual ~StringPimpl();
00179         
00202         void operator delete(void* p);
00203 
00228         void *operator new(size_t size);
00229 
00231 
00238         StringPimpl& operator+=(const StringPimpl &s);
00239 
00246         StringPimpl& operator+=(const char *s);
00247 
00257         bool operator!=(const char *s) const;
00258 
00268         StringPimpl operator+(const char *s) const;
00269 
00279         bool operator==(const StringPimpl &s) const;
00280         
00290         bool operator==(const char *s) const;
00291 
00302         bool startsWith(const StringPimpl &right) const;
00303 
00312         int getInteger() const
00313             throw(NumberFormatException &);
00314 
00329         bool existsAsAFile() const
00330             throw();
00331 
00346         bool existsAsADirectory() const
00347             throw();
00348         
00362         void transformIntoAbsoluteFilePath() const
00363             throw();
00364 
00373         StringPimpl operator+(const StringPimpl &s) const;
00374 
00383         StringPimpl &operator=(const char *c);
00384 
00393         StringPimpl &operator=(const char c);
00394 
00400         unsigned int size() const;
00401 
00407         unsigned int length() const;
00408 
00419         char at(const unsigned int i) const;
00420 
00430         bool operator<(const StringPimpl& s) const;
00431 
00441         bool operator!=(const StringPimpl &s) const;
00442 
00450         void push_back(char c);
00451 
00455         void clear();
00456     
00464         StringPimpl &transformToUpperCase()
00465             throw();
00466 
00474         StringPimpl &transformToLowerCase()
00475             throw();
00476 
00486         StringPimpl &transformByTrimmingWhiteSpace()
00487             throw();
00488 
00496         StringPimpl &transformFirstCharacterUpperCase()
00497             throw();
00498 
00507         StringPimpl &transformByTrimmingLeft()
00508             throw();
00509 
00518         StringPimpl &transformByTrimmingRight()
00519             throw();
00520 
00533         StringPimpl &transformByTrimmingExcessSpaces()
00534             throw();
00535 
00543         void removePunctuation(const StringPimpl &sentenceSplitters)
00544             throw();
00545     
00556         static StringPimpl getString(int number)
00557             throw(NumberFormatException &);
00558 
00559     private:
00560 
00571         void init(const char * const stringPimpl);
00572         
00580         StringPrivate *m_pimpl;
00581 };
00582 
00583 } 
00584 
00585 
00586 using rebecca::impl::StringPimpl;
00587 
00598 REBECCA_EXPORT bool operator==(const char *c, const StringPimpl &s);
00599 
00611 REBECCA_EXPORT StringPimpl operator+(const char *c, const StringPimpl &s);
00612 
00613 } 
00614 
00615 #ifdef _WIN32
00616 #    pragma warning ( pop )
00617 #endif
00618 
00619 
00620 
00621 
00622 
00623 #endif