String
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGTEXT_STRING
#define OSGTEXT_STRING 1
#include <vector>
#include <set>
#include <string>
#include <osgText/Export>
namespace osgText {
// ******************************** HACK **********************************
// Following class is needed to work around a DLL export problem. See file
// include/osg/PrimitiveSet for details.
class VectorUInt: public std::vector<unsigned int>
{
typedef std::vector<value_type> vector_type;
public:
VectorUInt(): vector_type() {}
VectorUInt(const VectorUInt &copy): vector_type(copy) {}
VectorUInt(unsigned int* beg, unsigned int* end): vector_type(beg, end) {}
explicit VectorUInt(unsigned int n): vector_type(n) {}
};
// **************************************************************************
class Text;
class OSGTEXT_EXPORT String : public VectorUInt
{
public:
typedef VectorUInt vector_type;
enum Encoding
{
ENCODING_UNDEFINED,
ENCODING_ASCII = ENCODING_UNDEFINED,
ENCODING_UTF8,
ENCODING_UTF16,
ENCODING_UTF16_BE,
ENCODING_UTF16_LE,
ENCODING_UTF32,
ENCODING_UTF32_BE,
ENCODING_UTF32_LE,
ENCODING_SIGNATURE,
ENCODING_CURRENT_CODE_PAGE
};
String() {}
String(const String& str);
String(const std::string& str) { set(str); }
String(const wchar_t* text) { set(text); }
String(const std::string& text,Encoding encoding) { set(text,encoding); }
String& operator = (const String& str);
void set(const std::string& str);
void set(const wchar_t* text);
void set(const std::string& text,Encoding encoding);
std::string createUTF8EncodedString() const;
protected:
};
}
#endif
osgText::String::createUTF8EncodedString
std::string createUTF8EncodedString() const
osgText::String::String
String(const std::string &text, Encoding encoding)
Definition String:72
osgText::String::String
String(const String &str)
osgText::String::set
void set(const std::string &text, Encoding encoding)
osgText::String::vector_type
VectorUInt vector_type
Definition String:47
osgText::String::String
String(const std::string &str)
Definition String:70
osgText::String::set
void set(const wchar_t *text)
osgText::String::String
String()
Definition String:68
osgText::String::String
String(const wchar_t *text)
Definition String:71
osgText::String::set
void set(const std::string &str)
osgText::String::Encoding
Encoding
Definition String:53
osgText::String::ENCODING_UTF32
@ ENCODING_UTF32
16-bit little-endian
Definition String:60
osgText::String::ENCODING_ASCII
@ ENCODING_ASCII
not using Unicode
Definition String:55
osgText::String::ENCODING_UTF16_BE
@ ENCODING_UTF16_BE
16-bit signature
Definition String:58
osgText::String::ENCODING_UTF16_LE
@ ENCODING_UTF16_LE
16-bit big-endian
Definition String:59
osgText::String::ENCODING_CURRENT_CODE_PAGE
@ ENCODING_CURRENT_CODE_PAGE
detect encoding from signature
Definition String:64
osgText::String::ENCODING_UTF8
@ ENCODING_UTF8
unsigned char ASCII
Definition String:56
osgText::String::ENCODING_UTF16
@ ENCODING_UTF16
8-bit unicode transformation format
Definition String:57
osgText::String::ENCODING_UTF32_LE
@ ENCODING_UTF32_LE
32-bit big-endian
Definition String:62
osgText::String::ENCODING_UNDEFINED
@ ENCODING_UNDEFINED
Definition String:54
osgText::String::ENCODING_UTF32_BE
@ ENCODING_UTF32_BE
32-bit signature
Definition String:61
osgText::String::ENCODING_SIGNATURE
@ ENCODING_SIGNATURE
32-bit little-endian
Definition String:63
osgText::VectorUInt::VectorUInt
VectorUInt(unsigned int *beg, unsigned int *end)
Definition String:35
osgText::VectorUInt::VectorUInt
VectorUInt()
Definition String:33
osgText::VectorUInt::VectorUInt
VectorUInt(const VectorUInt &copy)
Definition String:34
osgText::VectorUInt::VectorUInt
VectorUInt(unsigned int n)
Definition String:36
osgText
Export
OSGTEXT_EXPORT
#define OSGTEXT_EXPORT
Definition osgText/Export:39