system_traits Struct Template Reference
[System Library]

#include <winstl/system/system_traits.hpp>

Inheritance diagram for system_traits:

filesystem_traits reg_traits window_traits

List of all members.


Detailed Description

template<typename C>
struct winstl::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 ws_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 HINSTANCE module_type
 The type of a handle to a dynamically loaded module.
typedef HANDLE handle_type
 The type of a handle to a kernel object.
typedef DWORD 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.
Locale management
static int_type get_locale_info (LCID locale, LCTYPE type, char_type *data, int_type cchData)
 Returns the locale information.
Module Paths
static size_type get_module_filename (HINSTANCE hModule, char_type *buffer, size_type cchBuffer)
 Gets the full path name of the given module.
static size_type get_module_directory (HINSTANCE hModule, char_type *buffer, size_type cchBuffer)
 Gets the full path name of the directory of the given module.
static size_type get_system_directory (char_type *buffer, size_type cchBuffer)
 Gets the full path name of the system directory.
static size_type get_windows_directory (char_type *buffer, size_type cchBuffer)
 Gets the full path name of the windows directory.
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 FARPROC 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, reg_traits, and window_traits.

typedef size_t size_type

The size type.

Reimplemented in filesystem_traits, reg_traits, and window_traits.

typedef ws_ptrdiff_t difference_type

The difference type.

Reimplemented in filesystem_traits, reg_traits, and window_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 HINSTANCE module_type

The type of a handle to a dynamically loaded module.

Reimplemented in filesystem_traits.

typedef HANDLE handle_type

The type of a handle to a kernel object.

typedef DWORD 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 int_type get_locale_info ( LCID  locale,
LCTYPE  type,
char_type data,
int_type  cchData 
) [static]

Returns the locale information.

static size_type get_module_filename ( HINSTANCE  hModule,
char_type buffer,
size_type  cchBuffer 
) [static]

Gets the full path name of the given module.

static size_type get_module_directory ( HINSTANCE  hModule,
char_type buffer,
size_type  cchBuffer 
) [static]

Gets the full path name of the directory of the given module.

static size_type get_system_directory ( char_type buffer,
size_type  cchBuffer 
) [static]

Gets the full path name of the system directory.

static size_type get_windows_directory ( char_type buffer,
size_type  cchBuffer 
) [static]

Gets the full path name of the windows directory.

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 FARPROC 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
Precondition:
NULL != name

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:39 2010 for STLSoft by  doxygen 1.5.6