translationManager.h

Go to the documentation of this file.
00001 /* -*- Mode: c++ -*- */
00002 /*
00003  *  this is part of Spm
00004  *
00005  *  Copyright (c) 2007 Guillaume Chevallereau
00006  *
00007  *  This program is free software. You can redistribute it and/or modify it 
00008  *  under the terms of the GNU General Public License as published by the 
00009  *  Free Software Foundation. Either version 2 of the license or (at your 
00010  *  option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be usefull but WITHOUT
00013  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
00014  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
00015  *  more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License along 
00018  *  with this program; if not, write to the Free Software Foundation, Inc., 
00019  *  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
00020  */
00021 #ifndef __TRANSLATION_MANAGER__
00022 #define __TRANSLATION_MANAGER__
00023 
00024 #include <map>
00025 #include <boost/shared_ptr.hpp>
00026 #include <miniXml/ustring.h>
00027 
00028 namespace Spm
00029 {
00030   extern miniXml::ustring strUpper (const char * str);
00031   namespace Util
00032   {
00037     class TranslationManager
00038     {
00039     private :
00040       miniXml::ustring domain_;
00041       miniXml::ustring locale_;
00042       TranslationManager (const miniXml::ustring & domain,
00043                           const miniXml::ustring & localeDir);
00044       static std::map<miniXml::ustring,
00045                       boost::shared_ptr<TranslationManager> > instances_;
00046     public :
00052       static boost::shared_ptr<TranslationManager> & create(const miniXml::ustring & domain,
00053                                                             const miniXml::ustring & localeDir);
00054       
00059       void setLocale (const miniXml::ustring & locale);
00060 
00064       const miniXml::ustring & getLocale ();
00065 
00071       miniXml::ustring translate (const miniXml::ustring & message);
00072     };
00073   }
00074 }
00075 #endif

Generated on Sat Mar 21 17:00:14 2009 for libSpm by  doxygen 1.5.2