The Battle for Wesnoth  1.15.0+dev
Public Types | Public Member Functions | Private Attributes | List of all members
simple_wml::string_span Class Reference

#include <simple_wml.hpp>

Public Types

typedef const char * const_iterator
 
typedef const char * iterator
 
typedef const char value_type
 

Public Member Functions

 string_span ()
 
 string_span (const char *str, int size)
 
 string_span (const char *str)
 
 string_span (const char *begin, const char *end)
 
bool operator== (const char *o) const
 
bool operator!= (const char *o) const
 
bool operator== (const std::string &o) const
 
bool operator!= (const std::string &o) const
 
bool operator== (const string_span &o) const
 
bool operator!= (const string_span &o) const
 
bool operator< (const string_span &o) const
 
const char * begin () const
 
const char * end () const
 
int size () const
 
bool empty () const
 
bool is_null () const
 
bool to_bool (bool default_value=false) const
 
int to_int () const
 
std::string to_string () const
 
char * duplicate () const
 

Private Attributes

const char * str_
 
unsigned int size_
 

Detailed Description

Definition at line 33 of file simple_wml.hpp.

Member Typedef Documentation

◆ const_iterator

Definition at line 45 of file simple_wml.hpp.

◆ iterator

typedef const char* simple_wml::string_span::iterator

Definition at line 46 of file simple_wml.hpp.

◆ value_type

Definition at line 47 of file simple_wml.hpp.

Constructor & Destructor Documentation

◆ string_span() [1/4]

simple_wml::string_span::string_span ( )
inline

Definition at line 36 of file simple_wml.hpp.

◆ string_span() [2/4]

simple_wml::string_span::string_span ( const char *  str,
int  size 
)
inline

Definition at line 38 of file simple_wml.hpp.

◆ string_span() [3/4]

simple_wml::string_span::string_span ( const char *  str)
inline

Definition at line 40 of file simple_wml.hpp.

◆ string_span() [4/4]

simple_wml::string_span::string_span ( const char *  begin,
const char *  end 
)
inline

Definition at line 42 of file simple_wml.hpp.

Member Function Documentation

◆ begin()

const char* simple_wml::string_span::begin ( ) const
inline

◆ duplicate()

char * simple_wml::string_span::duplicate ( ) const

◆ empty()

bool simple_wml::string_span::empty ( ) const
inline

◆ end()

const char* simple_wml::string_span::end ( ) const
inline

◆ is_null()

bool simple_wml::string_span::is_null ( ) const
inline

Definition at line 94 of file simple_wml.hpp.

Referenced by wesnothd::game::is_legal_command().

◆ operator!=() [1/3]

bool simple_wml::string_span::operator!= ( const char *  o) const
inline

Definition at line 59 of file simple_wml.hpp.

References operator==().

◆ operator!=() [2/3]

bool simple_wml::string_span::operator!= ( const std::string &  o) const
inline

Definition at line 65 of file simple_wml.hpp.

References operator==().

◆ operator!=() [3/3]

bool simple_wml::string_span::operator!= ( const string_span o) const
inline

Definition at line 71 of file simple_wml.hpp.

References operator==().

◆ operator<()

bool simple_wml::string_span::operator< ( const string_span o) const
inline

Definition at line 74 of file simple_wml.hpp.

References n, size_, and str_.

◆ operator==() [1/3]

bool simple_wml::string_span::operator== ( const char *  o) const
inline

Definition at line 49 of file simple_wml.hpp.

◆ operator==() [2/3]

bool simple_wml::string_span::operator== ( const std::string &  o) const
inline

Definition at line 62 of file simple_wml.hpp.

◆ operator==() [3/3]

bool simple_wml::string_span::operator== ( const string_span o) const
inline

Definition at line 68 of file simple_wml.hpp.

References size_, and str_.

◆ size()

int simple_wml::string_span::size ( ) const
inline

◆ to_bool()

bool simple_wml::string_span::to_bool ( bool  default_value = false) const

Definition at line 157 of file simple_wml.cpp.

References empty().

Referenced by wesnothd::server::handle_join_game().

◆ to_int()

int simple_wml::string_span::to_int ( ) const

Definition at line 169 of file simple_wml.cpp.

References begin(), and size().

Referenced by wesnothd::game::is_legal_command().

◆ to_string()

std::string simple_wml::string_span::to_string ( ) const

Member Data Documentation

◆ size_

unsigned int simple_wml::string_span::size_
private

Definition at line 105 of file simple_wml.hpp.

Referenced by operator<(), and operator==().

◆ str_

const char* simple_wml::string_span::str_
private

Definition at line 104 of file simple_wml.hpp.

Referenced by operator<(), and operator==().


The documentation for this class was generated from the following files: