Loading...
Searching...
No Matches
ledger::unistring Class Reference

Abstract working with UTF-32 encoded Unicode strings. More...

#include <unistring.h>

Public Member Functions

std::string extract (const std::string::size_type begin=0, const std::string::size_type len=0) const
 
std::string extract_by_width (std::string::size_type begin, std::size_t len) const
 
std::size_t find (const boost::uint32_t __s, std::size_t __pos=0) const
 
std::size_t length () const
 
boost::uint32_t & operator[] (const std::size_t index)
 
const boost::uint32_t & operator[] (const std::size_t index) const
 
 unistring ()
 
 unistring (const std::string &input)
 
std::size_t width () const
 
 ~unistring ()
 

Public Attributes

std::vector< boost::uint32_t > utf32chars
 

Static Public Attributes

static const std::size_t npos = static_cast<std::size_t>(-1)
 

Detailed Description

Abstract working with UTF-32 encoded Unicode strings.

The input to the string is a UTF8 encoded ledger::string, which can then have its true length be taken, or characters extracted.

Definition at line 56 of file unistring.h.

Constructor & Destructor Documentation

◆ unistring() [1/2]

ledger::unistring::unistring ( )
inline

Definition at line 63 of file unistring.h.

References TRACE_CTOR.

◆ unistring() [2/2]

ledger::unistring::unistring ( const std::string & input)
inline

Definition at line 66 of file unistring.h.

References assert, ledger::downcast(), TRACE_CTOR, utf32chars, and VERIFY.

+ Here is the call graph for this function:

◆ ~unistring()

ledger::unistring::~unistring ( )
inline

Definition at line 78 of file unistring.h.

References TRACE_DTOR.

Member Function Documentation

◆ extract()

std::string ledger::unistring::extract ( const std::string::size_type begin = 0,
const std::string::size_type len = 0 ) const
inline

Definition at line 94 of file unistring.h.

References assert, ledger::downcast(), length(), and utf32chars.

+ Here is the call graph for this function:

◆ extract_by_width()

std::string ledger::unistring::extract_by_width ( std::string::size_type begin,
std::size_t len ) const
inline

Definition at line 114 of file unistring.h.

References assert, ledger::downcast(), length(), ledger::mk_wcwidth(), utf32chars, and width().

+ Here is the call graph for this function:

◆ find()

std::size_t ledger::unistring::find ( const boost::uint32_t __s,
std::size_t __pos = 0 ) const
inline

Definition at line 162 of file unistring.h.

References ledger::downcast(), npos, and utf32chars.

+ Here is the call graph for this function:

◆ length()

std::size_t ledger::unistring::length ( ) const
inline

Definition at line 82 of file unistring.h.

References utf32chars.

Referenced by extract(), and extract_by_width().

+ Here is the caller graph for this function:

◆ operator[]() [1/2]

boost::uint32_t & ledger::unistring::operator[] ( const std::size_t index)
inline

Definition at line 172 of file unistring.h.

References utf32chars.

◆ operator[]() [2/2]

const boost::uint32_t & ledger::unistring::operator[] ( const std::size_t index) const
inline

Definition at line 175 of file unistring.h.

References utf32chars.

◆ width()

std::size_t ledger::unistring::width ( ) const
inline

Definition at line 86 of file unistring.h.

References ledger::mk_wcwidth(), utf32chars, and width().

Referenced by extract_by_width(), and width().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ npos

const std::size_t ledger::unistring::npos = static_cast<std::size_t>(-1)
static

Definition at line 59 of file unistring.h.

Referenced by find().

◆ utf32chars

std::vector<boost::uint32_t> ledger::unistring::utf32chars

Definition at line 61 of file unistring.h.

Referenced by extract(), extract_by_width(), find(), length(), operator[](), operator[](), unistring(), and width().


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