system_traits Struct Template Reference
[System Library]

#include <unixstl/system/system_traits.hpp>

Inheritance diagram for system_traits:

filesystem_traits

List of all members.


Detailed Description

template<typename C>
struct unixstl::system_traits< C >

Traits for accessing the correct system functions for a given character type.

system_traits is a traits class for determining the correct system structures and functions for a given character type.

Parameters:
C The character type (e.g. char, wchar_t)

Public Types

Types
typedef C char_type
 The character type.
typedef size_t size_type
 The size type.
typedef us_ptrdiff_t difference_type
 The difference type.
typedef system_traits< C > class_type
 The current instantion of the type.
typedef int int_type
 The (signed) integer type.
typedef bool bool_type
 The Boolean type.
typedef void * module_type
 The type of a handle to a dynamically loaded module.
typedef int handle_type
 The type of a handle to a kernel object.
typedef int error_type
 The type of system error codes.

Static Public Member Functions

General string handling
static char_typechar_copy (char_type *dest, char_type const *src, size_type n)
 Copies a specific number of characters from the source to the destination.
static char_typestr_copy (char_type *dest, char_type const *src)
 Copies the contents of src to dest.
static char_typestr_n_copy (char_type *dest, char_type const *src, size_type cch)
 Copies the contents of src to dest, up to cch characters.
static char_typestr_cat (char_type *dest, char_type const *src)
 Appends the contents of src to dest.
static char_typestr_n_cat (char_type *dest, char_type const *src, size_type cch)
 Appends the contents of src to dest, up to cch characters.
static int_type str_compare (char_type const *s1, char_type const *s2)
 Comparies the contents of src and dest.
static int_type str_compare_no_case (char_type const *s1, char_type const *s2)
 Comparies the contents of src and dest in a case-insensitive fashion.
static int_type str_n_compare (char_type const *s1, char_type const *s2, size_type cch)
 Comparies the contents of src and dest up to cch characters.
static size_type str_len (char_type const *src)
 Evaluates the length of src.
static char_typestr_chr (char_type const *s, char_type ch)
 Finds the given character ch in s.
static char_typestr_rchr (char_type const *s, char_type ch)
 Finds the rightmost instance ch in s.
static char_typestr_str (char_type const *s, char_type const *sub)
 Finds the given substring sub in s.
static char_typestr_pbrk (char_type const *s, char_type const *charSet)
 Finds one of a set of characters in s.
static char_typestr_end (char_type const *s)
 Returns a pointer to the end of the string.
static char_typestr_set (char_type *s, size_type n, char_type c)
 Sets each character in s to the character c.
Dynamic Loading
static module_type load_library (char_type const *name)
 Loads the given executable module.
static bool_type free_library (module_type hModule)
 Closes the given executable module.
static void * find_symbol (module_type hModule, char const *symbolName)
 Retrieves the given symbol from the library.
Kernel object control
static bool_type close_handle (handle_type h)
 Closes the given operating system handle.
Error
static error_type get_last_error ()
 Gives the last error.
static void set_last_error (error_type er=error_type())
 Sets the last error.
Environment
static size_type get_environment_variable (char_type const *name, char_type *buffer, size_type cchBuffer)
 Gets an environment variable into the given buffer.
static size_type expand_environment_strings (char_type const *src, char_type *buffer, size_type cchBuffer)
 Expands environment strings in src into buffer, up to a maximum cchDest characters.

Member Typedef Documentation

typedef C char_type

The character type.

Reimplemented in filesystem_traits.

typedef size_t size_type

The size type.

Reimplemented in filesystem_traits.

typedef us_ptrdiff_t difference_type

The difference type.

Reimplemented in filesystem_traits.

The current instantion of the type.

Reimplemented in filesystem_traits.

typedef int int_type

The (signed) integer type.

Reimplemented in filesystem_traits.

typedef bool bool_type

The Boolean type.

Reimplemented in filesystem_traits.

typedef void* module_type

The type of a handle to a dynamically loaded module.

Reimplemented in filesystem_traits.

typedef int handle_type

The type of a handle to a kernel object.

typedef int error_type

The type of system error codes.

Reimplemented in filesystem_traits.


Member Function Documentation

static char_type* char_copy ( char_type dest,
char_type const *  src,
size_type  n 
) [static]

Copies a specific number of characters from the source to the destination.

static char_type* str_copy ( char_type dest,
char_type const *  src 
) [static]

Copies the contents of src to dest.

static char_type* str_n_copy ( char_type dest,
char_type const *  src,
size_type  cch 
) [static]

Copies the contents of src to dest, up to cch characters.

static char_type* str_cat ( char_type dest,
char_type const *  src 
) [static]

Appends the contents of src to dest.

static char_type* str_n_cat ( char_type dest,
char_type const *  src,
size_type  cch 
) [static]

Appends the contents of src to dest, up to cch characters.

static int_type str_compare ( char_type const *  s1,
char_type const *  s2 
) [static]

Comparies the contents of src and dest.

static int_type str_compare_no_case ( char_type const *  s1,
char_type const *  s2 
) [static]

Comparies the contents of src and dest in a case-insensitive fashion.

static int_type str_n_compare ( char_type const *  s1,
char_type const *  s2,
size_type  cch 
) [static]

Comparies the contents of src and dest up to cch characters.

static size_type str_len ( char_type const *  src  )  [static]

Evaluates the length of src.

static char_type* str_chr ( char_type const *  s,
char_type  ch 
) [static]

Finds the given character ch in s.

static char_type* str_rchr ( char_type const *  s,
char_type  ch 
) [static]

Finds the rightmost instance ch in s.

static char_type* str_str ( char_type const *  s,
char_type const *  sub 
) [static]

Finds the given substring sub in s.

static char_type* str_pbrk ( char_type const *  s,
char_type const *  charSet 
) [static]

Finds one of a set of characters in s.

static char_type* str_end ( char_type const *  s  )  [static]

Returns a pointer to the end of the string.

static char_type* str_set ( char_type s,
size_type  n,
char_type  c 
) [static]

Sets each character in s to the character c.

Returns:
s + n

static module_type load_library ( char_type const *  name  )  [static]

Loads the given executable module.

static bool_type free_library ( module_type  hModule  )  [static]

Closes the given executable module.

static void* find_symbol ( module_type  hModule,
char const *  symbolName 
) [static]

Retrieves the given symbol from the library.

static bool_type close_handle ( handle_type  h  )  [static]

Closes the given operating system handle.

static error_type get_last_error (  )  [static]

Gives the last error.

static void set_last_error ( error_type  er = error_type()  )  [static]

Sets the last error.

static size_type get_environment_variable ( char_type const *  name,
char_type buffer,
size_type  cchBuffer 
) [static]

Gets an environment variable into the given buffer.

Parameters:
name The name of the variable to find
buffer The buffer in which to write the variable. If this is NULL, then the required length is returned
cchBuffer The size of the buffer, in characters

static size_type expand_environment_strings ( char_type const *  src,
char_type buffer,
size_type  cchBuffer 
) [static]

Expands environment strings in src into buffer, up to a maximum cchDest characters.


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

Generated on Thu Jun 10 08:59:09 2010 for STLSoft by  doxygen 1.5.6