Page principale | Liste des namespaces | Hiérarchie des classes | Liste alphabétique | Liste des classes | Liste des fichiers | Membres de namespace | Membres de classe | Membres de fichier

Nom.h

Aller à la documentation de ce fichier.
00001 /*
00002     Copyright (c) 2005, Quentin Lequy and Romain Gaucher
00003     All rights reserved.
00004 
00005     Redistribution and use in source and binary forms, with or 
00006     without modification, are permitted provided that the following 
00007     conditions are met:
00008 
00009         * Redistributions of source code must retain the above copyright 
00010           notice, this list of conditions and the following disclaimer.
00011 
00012         * Redistributions in binary form must reproduce the above copyright 
00013           notice, this list of conditions and the following disclaimer in the 
00014           documentation and/or other materials provided with the distribution.
00015 
00016         * Neither the name of Quentin Lequy or Romain Gaucher nor the names 
00017           of its contributors may be used to endorse or promote products 
00018           derived from this software without specific prior written permission.
00019 
00020     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
00021     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
00022     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
00023     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
00024     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
00025     DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
00026     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
00027     AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
00028     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
00029     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030 */
00031 
00032 #ifndef __NOM_H
00033 #define __NOM_H
00034 
00035 #include <string>
00036 #include <sstream>
00037 
00038 namespace Modelib {
00039 
00051 class Nom
00052 {
00053   std::string nom;
00054 
00055 public:
00056 
00057   Nom(){};
00058   Nom(const std::string& _var) : nom(_var) {};
00059   Nom(const std::string& _var, const int _i     ) : nom(_var) { std::ostringstream s; s << _i; nom += std::string(s.str()); };
00060   Nom(const std::string& _var, const unsigned _i) : nom(_var) { std::ostringstream s; s << _i; nom += std::string(s.str()); };
00061   Nom(const std::string& _var, const long _i    ) : nom(_var) { std::ostringstream s; s << _i; nom += std::string(s.str()); };
00062   Nom(const std::string& _var, const float _i   ) : nom(_var) { std::ostringstream s; s << _i; nom += std::string(s.str()); };
00063   Nom(const std::string& _var, const double _i  ) : nom(_var) { std::ostringstream s; s << _i; nom += std::string(s.str()); };
00064   Nom(const std::string& _var, const char _i    ) : nom(_var) { std::ostringstream s; s << _i; nom += std::string(s.str()); };
00065 
00066   Nom(const std::string& _var, const int _i     , const int _j     ) : nom(_var) {  std::ostringstream s,ss; s << _i; nom += std::string(s.str()); s.clear(); ss << _j; nom += std::string(ss.str()); };
00067   Nom(const std::string& _var, const unsigned _i, const unsigned _j) : nom(_var) {  std::ostringstream s,ss; s << _i; nom += std::string(s.str()); s.clear(); ss << _j; nom += std::string(ss.str()); };
00068   Nom(const std::string& _var, const long _i    , const long _j    ) : nom(_var) {  std::ostringstream s,ss; s << _i; nom += std::string(s.str()); s.clear(); ss << _j; nom += std::string(ss.str()); };
00069   Nom(const std::string& _var, const float _i   , const float _j   ) : nom(_var) {  std::ostringstream s,ss; s << _i; nom += std::string(s.str()); s.clear(); ss << _j; nom += std::string(ss.str()); };
00070   Nom(const std::string& _var, const double _i  , const double _j  ) : nom(_var) {  std::ostringstream s,ss; s << _i; nom += std::string(s.str()); s.clear(); ss << _j; nom += std::string(ss.str()); };
00071   Nom(const std::string& _var, const char _i    , const char _j    ) : nom(_var) {  std::ostringstream s,ss; s << _i; nom += std::string(s.str()); s.clear(); ss << _j; nom += std::string(ss.str()); };
00072   
00073   Nom(const std::string& _var, const int _i     , const std::string& _c, const int _j     ) : nom(_var) { std::ostringstream s,ss; s << _i; nom += std::string(s.str()); nom += _c; s.clear(); ss << _j; nom += std::string(ss.str()); };
00074   Nom(const std::string& _var, const unsigned _i, const std::string& _c, const unsigned _j) : nom(_var) { std::ostringstream s,ss; s << _i; nom += std::string(s.str()); nom += _c; s.clear(); ss << _j; nom += std::string(ss.str()); };
00075   Nom(const std::string& _var, const long _i    , const std::string& _c, const long _j    ) : nom(_var) { std::ostringstream s,ss; s << _i; nom += std::string(s.str()); nom += _c; s.clear(); ss << _j; nom += std::string(ss.str()); };
00076   Nom(const std::string& _var, const float _i   , const std::string& _c, const float _j   ) : nom(_var) { std::ostringstream s,ss; s << _i; nom += std::string(s.str()); nom += _c; s.clear(); ss << _j; nom += std::string(ss.str()); };
00077   Nom(const std::string& _var, const double _i  , const std::string& _c, const double _j  ) : nom(_var) { std::ostringstream s,ss; s << _i; nom += std::string(s.str()); nom += _c; s.clear(); ss << _j; nom += std::string(ss.str()); };
00078   Nom(const std::string& _var, const char _i    , const std::string& _c, const char _j    ) : nom(_var) { std::ostringstream s,ss; s << _i; nom += std::string(s.str()); nom += _c; s.clear(); ss << _j; nom += std::string(ss.str()); };
00079   
00080   Nom& operator<<(const std::string& _str)
00081   {
00082     nom += _str;
00083     return *this;
00084   }
00085   Nom& operator<<(const int _i     ) { std::ostringstream s; s << _i; nom += std::string(s.str()); return *this;}
00086   Nom& operator<<(const unsigned _i) { std::ostringstream s; s << _i; nom += std::string(s.str()); return *this;}
00087   Nom& operator<<(const long _i    ) { std::ostringstream s; s << _i; nom += std::string(s.str()); return *this;}
00088   Nom& operator<<(const double _i  ) { std::ostringstream s; s << _i; nom += std::string(s.str()); return *this;}
00089   Nom& operator<<(const float _i   ) { std::ostringstream s; s << _i; nom += std::string(s.str()); return *this;}
00090   Nom& operator<<(const char _i    ) { std::ostringstream s; s << _i; nom += std::string(s.str()); return *this;}
00091 
00092   std::string operator()() const
00093   {
00094     return nom;
00095   }
00096 
00097   Nom( const Nom & _nom) { *this = _nom; }
00098   
00099   Nom & operator=( const Nom & _nom )
00100   {
00101      if( this != &_nom)
00102          nom = _nom.nom;
00103      return *this;
00104   }
00105 
00106   ~Nom(){};
00107 
00108   std::string GetNom() const {return nom; }
00109 
00110   void        Clear()        {nom.clear();}
00111   void        SetNom(const std::string& _nom) {nom = _nom;}
00112 
00113 };
00114 
00115 }
00116 
00117 #endif

Généré le Sun Oct 2 19:13:11 2005 pour Modelib par  doxygen 1.4.4