XdkWrl: sfstring.h Source File

Home | Hierarchy | Members | Alphabetical | Related Pages

# sfstring.h

Go to the documentation of this file.

    00001 #ifndef XDKWRL_SFSTRING_H
    00002 #define XDKWRL_SFSTRING_H
    00003
    00004 #include <xdkwrl/config.h>
    00005 #include <xdkwrl/fieldtypes.h>
    00006 #include <iostream>
    00007 #include <string>
    00008
    00009 namespace wrl
    00010 {
    00011   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00012   // Interface of  SFString
    00013   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00014   /*! \ingroup fieldtypes
    00015    *
    00016    * Represents a string value. Below is included the documentation for this
    00017    * field type from the ISO standard.
    00018    * \htmlinclude sfstring.html
    00019    */
    00020   class XDKWRL_EXPORT SFString
    00021   {
    00022   public:
    00023     inline SFString();
    00024     inline SFString(const char* c);
    00025     inline SFString(const std::string& s);
    00026     inline SFString& operator=(const char* b);
    00027     inline SFString& operator=(const std::string& b);
    00028     inline SFString& operator=(const SFString& b);
    00029     inline operator const char*() const;
    00030     inline operator std::string() const;
    00031     static inline const char* typeName();
    00032     static inline FieldTypeId typeId();
    00033     inline bool operator==(const SFString& s) const;
    00034     friend std::ostream& operator<<(std::ostream& s,const SFString& f);
    00035   protected:
    00036   private:
    00037     std::string value_;
    00038   };
    00039   //************************************************************
    00040   // Implementation of SFString
    00041   //************************************************************
    00042   inline
    00043   SFString::SFString()
    00044     : value_()
    00045   {
    00046   }
    00047   inline
    00048   SFString::SFString(const char* c)
    00049     : value_(c)
    00050   {
    00051   }
    00052   inline
    00053   SFString::SFString(const std::string& s)
    00054     : value_(s)
    00055   {
    00056   }
    00057   inline SFString&
    00058   SFString::operator=(const char* b)
    00059   {
    00060     value_ = b;
    00061     return *this;
    00062   }
    00063   inline SFString&
    00064   SFString::operator=(const std::string& b)
    00065   {
    00066     value_ = b;
    00067     return *this;
    00068   }
    00069   inline SFString&
    00070   SFString::operator=(const SFString& b)
    00071   {
    00072     value_ = b.value_;
    00073     return *this;
    00074   }
    00075   inline
    00076   SFString::operator const char*() const
    00077   {
    00078     return value_.c_str();
    00079   }
    00080   inline
    00081   SFString::operator std::string() const
    00082   {
    00083     return value_;
    00084   }
    00085   inline const char*
    00086   SFString::typeName()
    00087   {
    00088     return "SFString";
    00089   }
    00090   inline FieldTypeId
    00091   SFString::typeId()
    00092   {
    00093     return sfString;
    00094   }
    00095   inline bool
    00096   SFString::operator==(const SFString& s) const
    00097   {
    00098     return value_ == s.value_;
    00099   }
    00100 };
    00101
    00102 #endif // XDKWRL_SFSTRING_H

Generated on 5 Jan 2007 with version 1.5.1. |