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         
00173     private:
00174 
00185         void init(const char * const stringPimpl);
00186         
00194         StringPrivate *m_pimpl;
00195 };
00196 
00197 } //end namespace impl
00198 
00199 //expose StringPimpl to Rebecca namespace 
00200 using rebecca::impl::StringPimpl;
00201 
00202 } //end namespace rebecca
00203 
00204 #ifdef _WIN32
00205 #    pragma warning ( pop )
00206 #endif
00207 
00208 
00209 
00210 
00211 
00212 #endif

Generated on Tue Feb 14 22:44:57 2006 for RebeccaAIML by  doxygen 1.4.5