# Glib::Variant< std::string > Class Template Reference
[Variant Data Types]

Specialization of Glib::Variant containing a std::string (a non-capable UTF-8 string). More...

`#include <glibmm/variant.h>`

Inheritance diagram for Glib::Variant< std::string >:
[legend]

List of all members.

## Public Types

typedef char* | CType
typedef std::string | CppType

## Public Member Functions

| Variant ()
| Default constructor.
| Variant (GVariant* castitem, bool take_a_reference=false)
| GVariant constructor.
std::string | get () const
| Gets the contents of the Glib::Variant.

## Static Public Member Functions

static const Glib::VariantType& | variant_type ()
| Gets the Glib::VariantType.
static Variant< std::string > | create (const std::string& data)
| Creates a new Glib::Variant<std::string>.

## Detailed Description

### template <>
class Glib::Variant< std::string >

Specialization of Glib::Variant containing a std::string (a non-capable UTF-8 string).

Since glibmm 2.28:

## Member Typedef Documentation

typedef std::string Glib::Variant< std::string >::CppType

Reimplemented from Glib::VariantStringBase.

typedef char* Glib::Variant< std::string >::CType

Reimplemented from Glib::VariantStringBase.

## Constructor & Destructor Documentation

Glib::Variant< std::string >::Variant | ( | ) | `[inline]`

Default constructor.

Glib::Variant< std::string >::Variant | ( | GVariant< std::string > * | castitem,
|  | bool | take_a_reference = `false`
| ) |  | `[inline, explicit]`

GVariant constructor.

Parameters:

  castitem | The GVariant to wrap.
  take_a_reference | Whether to take an extra reference of the GVariant or not (not taking one could destroy the GVariant with the wrapper).

## Member Function Documentation

static Variant<std::string> Glib::Variant< std::string >::create | ( | const std::string & | data ) | `[static]`

Creates a new Glib::Variant<std::string>.

Parameters:

  data | The value of the new Glib::Variant.

Returns:
  The new Glib::Variant.

Since glibmm 2.28:

std::string Glib::Variant< std::string >::get | ( | ) | const

Gets the contents of the Glib::Variant.

Returns:
  The contents of the Glib::Variant.

Since glibmm 2.28:

static const Glib::VariantType& Glib::Variant< std::string >::variant_type | ( | ) | `[static]`

Gets the Glib::VariantType.

Returns:
  The Glib::VariantType.

Since glibmm 2.28: