glibmm 2.84.0
Glib::DBusObjectPathString Class Reference

String class for D-Bus object paths in Glib::Variant. More...

#include <glibmm/variantdbusstring.h>

Inheritance diagram for Glib::DBusObjectPathString:

Public Member Functions

 ustring ()
 ustring (const ustring & other)
 ustring (ustring && other)
 ustring (const std::string & src)
 ustring (std::string && src)
 ustring (const ustring & src, size_type i, size_type n=npos)
 ustring (const char * src, size_type n)
 ustring (const char * src)
 ustring (size_type n, gunichar uc)
 ustring (size_type n, char c)
template<class In>
 ustring (In pbegin, In pend)
Public Member Functions inherited from Glib::ustring
 ustring ()
 ~ustring () noexcept
 ustring (const ustring & other)
 ustring (ustring && other)
ustringoperator= (const ustring & other)
ustringoperator= (ustring && other)
void swap (ustring & other)
 ustring (const std::string & src)
 ustring (std::string && src)
 ustring (const ustring & src, size_type i, size_type n=npos)
 ustring (const char * src, size_type n)
 ustring (const char * src)
 ustring (size_type n, gunichar uc)
 ustring (size_type n, char c)
template<class In>
 ustring (In pbegin, In pend)
ustringoperator= (const std::string & src)
ustringoperator= (std::string && src)
ustringoperator= (const char * src)
ustringoperator= (gunichar uc)
ustringoperator= (char c)
ustringassign (const ustring & src)
ustringassign (ustring && src)
ustringassign (const ustring & src, size_type i, size_type n)
ustringassign (const char * src, size_type n)
ustringassign (const char * src)
ustringassign (size_type n, gunichar uc)
ustringassign (size_type n, char c)
template<class In>
ustringassign (In pbegin, In pend)
ustringoperator+= (const ustring & src)
ustringoperator+= (const char * src)
ustringoperator+= (gunichar uc)
ustringoperator+= (char c)
void push_back (gunichar uc)
void push_back (char c)
ustringappend (const ustring & src)
ustringappend (const ustring & src, size_type i, size_type n)
ustringappend (const char * src, size_type n)
ustringappend (const char * src)
ustringappend (size_type n, gunichar uc)
ustringappend (size_type n, char c)
template<class In>
ustringappend (In pbegin, In pend)
ustringinsert (size_type i, const ustring & src)
ustringinsert (size_type i, const ustring & src, size_type i2, size_type n)
ustringinsert (size_type i, const char * src, size_type n)
ustringinsert (size_type i, const char * src)
ustringinsert (size_type i, size_type n, gunichar uc)
ustringinsert (size_type i, size_type n, char c)
iterator insert (iterator p, gunichar uc)
iterator insert (iterator p, char c)
void insert (iterator p, size_type n, gunichar uc)
void insert (iterator p, size_type n, char c)
template<class In>
void insert (iterator p, In pbegin, In pend)
ustringreplace (size_type i, size_type n, const ustring & src)
ustringreplace (size_type i, size_type n, const ustring & src, size_type i2, size_type n2)
ustringreplace (size_type i, size_type n, const char * src, size_type n2)
ustringreplace (size_type i, size_type n, const char * src)
ustringreplace (size_type i, size_type n, size_type n2, gunichar uc)
ustringreplace (size_type i, size_type n, size_type n2, char c)
ustringreplace (iterator pbegin, iterator pend, const ustring & src)
ustringreplace (iterator pbegin, iterator pend, const char * src, size_type n)
ustringreplace (iterator pbegin, iterator pend, const char * src)
ustringreplace (iterator pbegin, iterator pend, size_type n, gunichar uc)
ustringreplace (iterator pbegin, iterator pend, size_type n, char c)
template<class In>
ustringreplace (iterator pbegin, iterator pend, In pbegin2, In pend2)
void clear ()
ustringerase (size_type i, size_type n=npos)
ustringerase ()
iterator erase (iterator p)
iterator erase (iterator pbegin, iterator pend)
int compare (UStringView rhs) const
int compare (size_type i, size_type n, UStringView rhs) const
int compare (size_type i, size_type n, const ustring & rhs, size_type i2, size_type n2) const
int compare (size_type i, size_type n, const char * rhs, size_type n2) const
std::string collate_key () const
std::string casefold_collate_key () const
value_type operator[] (size_type i) const
value_type at (size_type i) const
ustring substr (size_type i=0, size_type n=npos) const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
reverse_iterator rbegin ()
reverse_iterator rend ()
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const
const_iterator cbegin () const
const_iterator cend () const
size_type find (const ustring & str, size_type i=0) const
size_type find (const char * str, size_type i, size_type n) const
size_type find (const char * str, size_type i=0) const
size_type find (gunichar uc, size_type i=0) const
size_type find (char c, size_type i=0) const
size_type rfind (const ustring & str, size_type i=npos) const
size_type rfind (const char * str, size_type i, size_type n) const
size_type rfind (const char * str, size_type i=npos) const
size_type rfind (gunichar uc, size_type i=npos) const
size_type rfind (char c, size_type i=npos) const
size_type find_first_of (const ustring & match, size_type i=0) const
size_type find_first_of (const char * match, size_type i, size_type n) const
size_type find_first_of (const char * match, size_type i=0) const
size_type find_first_of (gunichar uc, size_type i=0) const
size_type find_first_of (char c, size_type i=0) const
size_type find_last_of (const ustring & match, size_type i=npos) const
size_type find_last_of (const char * match, size_type i, size_type n) const
size_type find_last_of (const char * match, size_type i=npos) const
size_type find_last_of (gunichar uc, size_type i=npos) const
size_type find_last_of (char c, size_type i=npos) const
size_type find_first_not_of (const ustring & match, size_type i=0) const
size_type find_first_not_of (const char * match, size_type i, size_type n) const
size_type find_first_not_of (const char * match, size_type i=0) const
size_type find_first_not_of (gunichar uc, size_type i=0) const
size_type find_first_not_of (char c, size_type i=0) const
size_type find_last_not_of (const ustring & match, size_type i=npos) const
size_type find_last_not_of (const char * match, size_type i, size_type n) const
size_type find_last_not_of (const char * match, size_type i=npos) const
size_type find_last_not_of (gunichar uc, size_type i=npos) const
size_type find_last_not_of (char c, size_type i=npos) const
bool empty () const
 Returns true if the string is empty.
size_type size () const
 Returns the number of characters in the string, not including any null-termination.
size_type length () const
 This is the same as size().
size_type bytes () const
 Returns the number of bytes in the string, not including any null-termination.
void resize (size_type n, gunichar uc)
void resize (size_type n, char c='\0')
size_type capacity () const
size_type max_size () const
void reserve (size_type n=0)
 operator std::string () const
const std::stringraw () const
std::string release ()
const char * data () const
const char * c_str () const
size_type copy (char * dest, size_type n, size_type i=0) const
bool validate () const
bool validate (iterator & first_invalid)
bool validate (const_iterator & first_invalid) const
ustring make_valid () const
bool is_ascii () const
ustring normalize (NormalizeMode mode=NormalizeMode::DEFAULT_COMPOSE) const
ustring truncate_middle (gsize truncate_length) const
ustring uppercase () const
ustring lowercase () const
ustring casefold () const

Additional Inherited Members

Public Types inherited from Glib::ustring
using size_type = std::string::size_type
using difference_type = std::string::difference_type
using value_type = gunichar
using reference = gunichar&
using const_reference = const gunichar&
using iterator = ustring_Iterator<std::string::iterator>
using const_iterator = ustring_Iterator<std::string::const_iterator>
using reverse_iterator = std::reverse_iterator<iterator>
using const_reverse_iterator = std::reverse_iterator<const_iterator>
Static Public Member Functions inherited from Glib::ustring
static ustring compose (const ustring & fmt)
template<class... Ts>
static ustring compose (const ustring & fmt, const Ts &... args)
template<class... Ts>
static ustring format (const Ts &... args)
template<class... Ts>
static ustring sprintf (const ustring & fmt, const Ts &... args)
template<class... Ts>
static ustring sprintf (const char * fmt, const Ts &... args)
static ustring sprintf (const ustring & fmt)
static ustring sprintf (const char * fmt)
Static Public Attributes inherited from Glib::ustring
static const size_type npos = std::string::npos

Detailed Description

String class for D-Bus object paths in Glib::Variant.

Use it if you want to create a Glib::Variant with D-Bus object paths.

using opstring_with_string_t =
opstring_with_string_t map1;
map1["/map1/path1"] = Glib::Variant<Glib::ustring>::create("value1");
Template class used for the specialization of the Variant<> classes.
Definition variant.h:927
Since glibmm 2.54

Member Function Documentation

◆ ustring() [1/11]

Glib::ustring::ustring ( )

Default constructor, which creates an empty string.

◆ ustring() [2/11]

Glib::ustring::ustring ( const char * src)

Construct a ustring as a copy of a C string.

Parameters
srcSource C string encoded as UTF-8.

◆ ustring() [3/11]

Glib::ustring::ustring ( const char * src,
size_type n )

Construct a ustring as a partial copy of a C string.

Parameters
srcSource C string encoded as UTF-8.
nNumber of UTF-8 characters to copy.

◆ ustring() [4/11]

Glib::ustring::ustring ( const std::string & src)

Construct a ustring as a copy of a std::string.

Parameters
srcA source std::string containing text encoded as UTF-8.

◆ ustring() [5/11]

Glib::ustring::ustring ( const ustring & other)

Construct a ustring as a copy of another ustring.

Parameters
otherA source string.

◆ ustring() [6/11]

Glib::ustring::ustring ( const ustring & src,
size_type i,
size_type n = npos )

Construct a ustring as a copy of a substring.

Parameters
srcSource ustring.
iIndex of first character to copy from.
nNumber of UTF-8 characters to copy (defaults to copying the remainder).

◆ ustring() [7/11]

template <class In>
Glib::ustring::ustring ( In pbegin,
In pend )

Construct a ustring as a copy of a range.

Parameters
pbeginStart of range.
pendEnd of range.

◆ ustring() [8/11]

Glib::ustring::ustring ( size_type n,
char c )

Construct a ustring as multiple characters.

Parameters
nNumber of characters.
cASCII character to use.

◆ ustring() [9/11]

Glib::ustring::ustring ( size_type n,
gunichar uc )

Construct a ustring as multiple characters.

Parameters
nNumber of characters.
ucUCS-4 code point to use.

◆ ustring() [10/11]

Glib::ustring::ustring ( std::string && src)

Construct a ustring by moving from a std::string.

Parameters
srcA source std::string containing text encoded as UTF-8.

◆ ustring() [11/11]

Glib::ustring::ustring ( ustring && other)

Construct a ustring by moving from another ustring.

Parameters
otherA source string.