OGLplus (0.45.0) a C++ wrapper for OpenGL

String literal wrapper. More...

#include </home/chochlik/devel/oglplus/include/oglplus/string.hpp>

Public Types

typedef const GLchar * iterator
 character iterator
 
typedef const GLchar * const_iterator
 character iterator
 

Public Member Functions

 StrLit (void)
 Default constructor.
 
 StrLit (std::nullptr_t)
 Construction from nullptr.
 
 StrLit (const GLchar *literal)
 Construction from a c-string literal. More...
 
 StrLit (const GLchar *lit, std::size_t lit_size)
 Construction from a c-string and a length. More...
 
String str (void) const
 Efficient conversion to String.
 
const GLchar * c_str (void) const
 Returns the c-string literal.
 
std::size_t size (void) const
 Returns the size (in GLchars) of the literal.
 
bool empty (void) const
 Returns true if the literal is empty.
 
const_iterator begin (void) const
 returns a const iterator to the first character in the literal
 
const_iterator end (void) const
 returns a const iterator past the last character in the literal
 
 operator bool (void) const
 Equivalent to !empty()
 
bool operator! (void) const
 Equivalent to the empty() function.
 

Friends

const_iterator begin (const StrLit &strlit)
 returns a const iterator to the first character in the literal
 
const_iterator end (const StrLit &strlit)
 returns a const iterator past the last character in the literal
 
Unspecified operator+ (StrLit a, StrLit b)
 Literal concatenation operator. More...
 

Detailed Description

String literal wrapper.

The literal optionally checks the source c-string literal for UTF-8 validity (which is required by the OpenGL specification for input string parameters of GL functions).

See Also
OGLPLUS_NO_UTF8_CHECKS
Examples:
standalone/001_program_resources.cpp, standalone/004_any_text_rendering.cpp, standalone/004_bitmap_text_hello.cpp, standalone/004_bitmap_text_rendering.cpp, standalone/004_pango_cairo_hello.cpp, standalone/004_stbttf_text_rendering.cpp, and standalone/025_bitmap_font_text.cpp.

Constructor & Destructor Documentation

oglplus::StrLit::StrLit ( const GLchar *  literal)
explicit

Construction from a c-string literal.

The input literal can be optionally checked for UTF-8 validity.

See Also
OGLPLUS_NO_UTF8_CHECKS
oglplus::StrLit::StrLit ( const GLchar *  lit,
std::size_t  lit_size 
)
explicit

Construction from a c-string and a length.

The input literal can be optionally checked for UTF-8 validity.

See Also
OGLPLUS_NO_UTF8_CHECKS

Friends And Related Function Documentation

Unspecified operator+ ( StrLit  a,
StrLit  b 
)
friend

Literal concatenation operator.

Returns an unspecified type explicitly convertible to String


The documentation for this class was generated from the following file:
  • /home/chochlik/devel/oglplus/include/oglplus/string.hpp

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Wed Apr 30 2014 by Doxygen (version 1.8.4).