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 
00097         StringPimpl(const char * const stringPimpl) throw(Exception &);
00098         
00111         const char *c_str() const throw(Exception &);
00112 
00124         bool empty() const throw(Exception &);
00125 
00136         StringPimpl(const StringPimpl& stringPimpl);
00137 
00148         StringPimpl &StringPimpl::operator=(const StringPimpl &stringPimpl);
00149 
00158         virtual ~StringPimpl();
00159         
00160     private:
00161 
00172         void init(const char * const stringPimpl);
00173         
00181         StringPrivate *m_pimpl;
00182 };
00183 
00184 } //end namespace impl
00185 
00186 //expose StringPimpl to Rebecca namespace 
00187 using rebecca::impl::StringPimpl;
00188 
00189 } //end namespace rebecca
00190 
00191 #ifdef _WIN32
00192 #    pragma warning ( pop )
00193 #endif
00194 
00195 
00196 
00197 
00198 
00199 #endif

Generated on Wed Oct 12 23:40:33 2005 for RebeccaAIML by  doxygen 1.4.5