StringPimpl.h

00001 #ifndef REBECCA_STRINGPIMPL_H
00002 #define REBECCA_STRINGPIMPL_H
00003 
00004 /*
00005  * RebeccaAIML, Artificial Intelligence Markup Language 
00006  * C++ api and engine.
00007  *
00008  * Copyright (C) 2005 Frank Hassanabad
00009  *
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2.1 of the License, or (at your option) any later version.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00023  */
00024 
00025 
00026 //To get the REBECA_EXPORT macro
00027 #include <rebecca/exports.h>
00028 
00029 #include <rebecca/Exceptions.h>
00030 
00031 /* Disable Windows VC 7.x warning about 
00032  * it ignoring the throw specification
00033  */
00034 #ifdef _WIN32
00035 #    pragma warning ( push )
00036 #    pragma warning( disable : 4290 )
00037 #endif
00038 
00039 
00040 //See AimlFacade for the explanation of this namespace
00041 namespace rebecca
00042 {
00043 //See AimlFacade for the explanation of this namespace
00044 namespace impl
00045 {
00046 
00047 
00048 
00049 /*
00050  * The private String which I do not expose.
00051  * 
00052  * This forward decleration is so that the code will 
00053  * compile but the true string is kept private within
00054  * this class.
00055  */ 
00056 class StringPrivate;
00057 
00079 class REBECCA_EXPORT StringPimpl
00080 {
00081     public:
00082 
00094         StringPimpl() throw(Exception &);
00095 
00110         StringPimpl(const char * const stringPimpl) throw(Exception &);
00111         
00124         const char *c_str() const throw(Exception &);
00125 
00137         bool empty() const throw(Exception &);
00138 
00149         StringPimpl(const StringPimpl& stringPimpl);
00150 
00161         StringPimpl &StringPimpl::operator=(const StringPimpl &stringPimpl);
00162 
00171         virtual ~StringPimpl();
00172         
00195         void operator delete(void* p);
00196 
00221         void *operator new(unsigned int size);
00222 
00223     private:
00224 
00235         void init(const char * const stringPimpl);
00236         
00244         StringPrivate *m_pimpl;
00245 };
00246 
00247 } //end namespace impl
00248 
00249 //expose StringPimpl to Rebecca namespace 
00250 using rebecca::impl::StringPimpl;
00251 
00252 } //end namespace rebecca
00253 
00254 #ifdef _WIN32
00255 #    pragma warning ( pop )
00256 #endif
00257 
00258 
00259 
00260 
00261 
00262 #endif

Generated on Mon Apr 10 00:40:01 2006 for RebeccaAIML by  doxygen 1.4.5