Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# Xfc Namespace Reference

The primary namespace for the Xfce Foundation Classes. More...

## Classes

- class Xfc::IntegerObject< IntegerType >
    A C++ template base class for integer objects. More...
- class Xfc::Object
    Reference counting base class. More...
- class Xfc::Pointer< T >
    Smart pointer template class. More...
- class Xfc::StackObject
    A C++ base class for automatic (or stack) objects. More...
- class Xfc::Trackable
    The primary base class for the XFC object hierarchy. More...
- class Xfc::StringIterator
    UTF-8 string iterator base class. More...
- class Xfc::Forward_StringIterator
    A const non-random access iterator that iterates over a String in the forward direction. More...
- class Xfc::Reverse_StringIterator
    A const non-random access iterator that iterates over a String in the reverse direction. More...
- class Xfc::String
    A UTF-8 standard string compatible string class. More...

## GetText Methods

- const char * _ (const String &str)
    Convenient wrapper for GNU gettext.
- const char * _ (const String &str, const char *domain)
    Convenient wrapper for GNU dgettext.

## IntegerObject equality operators

- template<typename IntegerType> bool operator== (const IntegerObject< IntegerType > &lhs, IntegerType rhs)
    Equality operator.
- template<typename IntegerType> bool operator== (IntegerType lhs, const IntegerObject< IntegerType > &rhs)
    Equality operator.
- template<typename IntegerType> bool operator!= (const IntegerObject< IntegerType > &lhs, IntegerType rhs)
    Inequality operator.
- template<typename IntegerType> bool operator!= (IntegerType lhs, const IntegerObject< IntegerType > &rhs)
    Inequality operator.

## Smart pointer C++-style casting functions

- template<typename To, typename From> Pointer< To > cast_const (const Pointer< From > &from)
    Removes the const qualifier from a managed const dumb pointer.
- template<typename To, typename From> Pointer< To > cast_dynamic (const Pointer< From > &from)
    Casts a managed polymophic dumb pointer down or across its inheritance heirarchy.
- template<typename To, typename From> Pointer< To > cast_static (const Pointer< From > &from)
    Casts a managed dumb pointer to a pointer to a related type.

## String i/o stream operators

- std::istream & operator>> (std::istream &is, String &str)
    Read a whitespace-terminated word from an istream to the string str.
- std::ostream & operator<< (std::ostream &os, const String &str)
    Write the string str to an ostream.

## StringIterator comparison operators

- bool operator== (const StringIterator &lhs, const StringIterator &rhs)
    Returns true if the string iterators lhs and rhs point to the same character.
- bool operator!= (const StringIterator &lhs, const StringIterator &rhs)
    Returns true if the string iterators lhs and rhs do not point to the same character.
- bool operator< (const StringIterator &lhs, const StringIterator &rhs)
    Returns true if lhs points to a character in a string that is before the character pointed to by rhs.
- bool operator> (const StringIterator &lhs, const StringIterator &rhs)
    Returns true if lhs points to a character in a string that is after the character pointed to by rhs.
- bool operator<= (const StringIterator &lhs, const StringIterator &rhs)
    Returns true if lhs points to a character in a string that is before the character or is the same character pointed to by rhs.
- bool operator>= (const StringIterator &lhs, const StringIterator &rhs)
    Returns true if lhs points to a character in a string that is the same character or after the character pointed to by rhs.

## String concatenation operators

- String operator+ (const String &lhs, const String &rhs)
    Append the string rhs to the end of the string lhs and return the result as a new String.
- String operator+ (const char *lhs, const String &rhs)
    Append the string rhs to the end of the character array lhs and return the result as a new String.
- String operator+ (char c, const String &rhs)
    Append the string rhs to the character c and return the result as a new String.
- String operator+ (const String &lhs, const char *rhs)
    Append the character array rhs to the end of the string lhs and return the result as a new String.
- String operator+ (const String &lhs, char c)
    Append the character c to the end of the string lhs and return the result as a new String.

## String comparison operators

- bool operator== (const String &lhs, const String &rhs)
    Returns true if the string lhs and the string rhs are characterwise equal.
- bool operator== (const char *lhs, const String &rhs)
    Returns true if the character array lhs and the string rhs are characterwise equal.
- bool operator== (const String &lhs, const char *rhs)
    Returns true if the string lhs and the character array rhs are characterwise equal.
- bool operator!= (const char *lhs, const String &rhs)
    Returns true if the character array lhs and the string rhs are not characterwise equal.
- bool operator!= (const String &lhs, const char *rhs)
    Returns true if the string lhs and the character array rhs are not characterwise equal.
- bool operator< (const String &lhs, const String &rhs)
    Returns true if the string lhs is lexicographically before the string rhs.
- bool operator< (const char *lhs, const String &rhs)
    Returns true if the character array lhs is lexicographically before the string rhs.
- bool operator< (const String &lhs, const char *rhs)
    Returns true if the string lhs is lexicographically before the character array rhs.
- bool operator> (const char *lhs, const String &rhs)
    Returns true if the character array lhs is lexicographically greater the string rhs.
- bool operator> (const String &lhs, const char *rhs)
    Returns true if the string lhs is lexicographically greater the character array rhs.
- bool operator<= (const char *lhs, const String &rhs)
    Returns true if the character array lhs is lexicographically before or equal to the string rhs.
- bool operator<= (const String &lhs, const char *rhs)
    Returns true if the string lhs is lexicographically before or equal to the character array rhs.
- bool operator>= (const char *lhs, const String &rhs)
    Returns true if the character array lhs is lexicographically greater or equal to the string rhs.
- bool operator>= (const String &lhs, const char *rhs)
    Returns true if the string lhs is lexicographically greater or equal to the character array rhs.
- bool operator!= (const String &lhs, const String &rhs)
    Returns true if the string lhs and the string rhs are not characterwise equal.
- bool operator> (const String &lhs, const String &rhs)
    Returns true if the string lhs is lexicographically greater the string rhs.
- bool operator<= (const String &lhs, const String &rhs)
    Returns true if the string lhs is lexicographically before or equal to the string rhs.
- bool operator>= (const String &lhs, const String &rhs)
    Returns true if the string lhs is lexicographically greater or equal to the string rhs.

## Detailed Description

The primary namespace for the Xfce Foundation Classes.

## Function Documentation

const char* _ | ( | const String & | str,
|  | const char * | domain
| ) |

Convenient wrapper for GNU dgettext.

Parameters:

  | str | A String to be passed to dgettext().
  | domain | The name of translation domain; will always be a string literal.

Returns:
  The translation of str if it's available in domain.

GNU gettext does two things. First, it marks a string as translable so xgettext() will find it when it scans your sources. The second thing it does is actually return the translated string. If no translation of str is available the str itself is returned. Libraries must specify the domain because the global domain is reserved for use by applications. Libraries use this method instead of defining a _ macro that calls dgettext(). When you run xgettext() don't forget to specify the '--keyword=_' option. This option tells xgettext that translatable strings are marked with an underscore instead of the word gettext.

const char* _ | ( | const String & | str | ) |

Convenient wrapper for GNU gettext.

Parameters:

  | str | A String to be passed to gettext().

Returns:
  The translation of str if it's available in the current domain.

GNU gettext does two things. First, it marks a string as translable so xgettext() will find it when it scans your sources. The second thing it does is actually return the translated string. If no translation of str is available the str itself is returned. Applications should use this method instead of defining a _ macro that calls gettext(). When you run xgettext() don't forget to specify the '--keyword=_' option. This option tells xgettext that translatable strings are marked with an underscore instead of the word gettext.

template<typename To, typename From>
Pointer<To> cast_const | ( | const Pointer< From > & | from | ) | `[inline]`

Removes the const qualifier from a managed const dumb pointer.

Parameters:

  | from | A Pointer that manages a const dumb pointer.

Returns:
  A new Pointer that manages the non-const dumb pointer.

Calls const_cast on the dumb pointer and returns the non-const pointer as a new Pointer.

template<typename To, typename From>
Pointer<To> cast_dynamic | ( | const Pointer< From > & | from | ) | `[inline]`

Casts a managed polymophic dumb pointer down or across its inheritance heirarchy.

Parameters:

  | from | A Pointer managing a polymophic dumb pointer of type From.

Returns:
  A new Pointer managing the dumb pointer as a base or sibling pointer of type To.

Calls dynmaic_cast to safely cast a managed polymophic dumb pointer of type From to a base, derived or sibling class pointer of type To.

template<typename To, typename From>
Pointer<To> cast_static | ( | const Pointer< From > & | from | ) | `[inline]`

Casts a managed dumb pointer to a pointer to a related type.

Parameters:

  | from | A Pointer managing a dumb pointer of type From.

Returns:
  A new Pointer managing the dumb pointer as a pointer of type To.

Calls static_cast to cast a dumb pointer of type From to a pointer of type To.

template<typename IntegerType>
bool operator!= | ( | IntegerType | lhs,
|  | const IntegerObject< IntegerType > & | rhs
| ) | `[inline]`

Inequality operator.

Parameters:

  | lhs | A value of type IntegerType.
  | rhs | An IntegerObject.

Returns:
  true if the value of rhs is equal to lhs.

template<typename IntegerType>
bool operator!= | ( | const IntegerObject< IntegerType > & | lhs,
|  | IntegerType | rhs
| ) | `[inline]`

Inequality operator.

Parameters:

  | lhs | An IntegerObject.
  | rhs | A value of type IntegerType.

Returns:
  true if the value of lhs is equal to rhs.

template<typename IntegerType>
bool operator== | ( | IntegerType | lhs,
|  | const IntegerObject< IntegerType > & | rhs
| ) | `[inline]`

Equality operator.

Parameters:

  | lhs | A value of type IntegerType.
  | rhs | An IntegerObject.

Returns:
  true if the value of rhs is equal to lhs.

template<typename IntegerType>
bool operator== | ( | const IntegerObject< IntegerType > & | lhs,
|  | IntegerType | rhs
| ) | `[inline]`

Equality operator.

Parameters:

  | lhs | An IntegerObject.
  | rhs | A value of type IntegerType.

Returns:
  true if the value of lhs is equal to rhs.

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3