filesystem_traits Struct Template Reference
[File System Library]

#include <inetstl/filesystem/filesystem_traits.hpp>

List of all members.


Detailed Description

template<typename C>
struct inetstl::filesystem_traits< C >

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

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

Parameters:
C The character type

Public Types

Member Types
typedef C char_type
 The character type.
typedef size_t size_type
 The size type.
typedef is_ptrdiff_t difference_type
 The difference type.
typedef WIN32_FIND_DATA find_data_type
 The find data type.
typedef WIN32_FIND_DATA stat_data_type
 The stat data type.
typedef filesystem_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 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_t 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 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.
File-system entry names
static char_typeensure_dir_end (char_type *dir)
 Appends a path name separator to dir if one does not exist.
static char_typeremove_dir_end (char_type *dir)
 Removes the path name separator from the end of dir, if it has it.
static bool_type has_dir_end (char_type const *dir)
 Returns true if dir has trailing path name separator.
static bool_type is_dots (char_type const *dir)
 Returns true if dir is "." or "..".
static bool_type is_path_rooted (char_type const *path)
 Returns true if path is rooted.
static bool_type is_path_absolute (char_type const *path)
 Returns true if path is an absolute path.
static bool_type is_path_name_separator (char_type ch)
 Returns true if the character is a path-name separator.
static char_type path_separator ()
 Returns the path separator.
static char_type path_name_separator ()
 Returns the path name separator.
static char_type const * pattern_all ()
 Returns the wildcard pattern that represents all possible matches.
static size_type get_full_path_name (HINTERNET hconn, char_type const *fileName, size_type cchBuffer, char_type *buffer, char_type **ppFile)
 Gets the full path name into the given buffer, returning a pointer to the file-part.
static size_type get_full_path_name (HINTERNET hconn, char_type const *fileName, size_type cchBuffer, char_type *buffer)
 Gets the full path name into the given buffer.
Internet connectivity
static HINTERNET internet_open (char_type const *agent, is_dword_t accessType, char_type const *proxy, char_type const *proxyBypass, is_dword_t flags)
 Opens a WinInet session.
static HINTERNET internet_connect (HINTERNET hsess, char_type const *server, INTERNET_PORT port, char_type const *userName, char_type const *password, is_dword_t service, is_dword_t flags, is_dword_t context)
 Makes a connection to a FTP or HTTP site.
static void close_connection (HINTERNET hconn)
 Closes the connection to the FTP or HTTP site.
File-system enumeration
static HINTERNET find_first_file (HINTERNET hconn, char_type const *spec, find_data_type *findData, is_dword_t flags=0, is_dword_t context=0)
 Initiate a file-system search.
static bool_type find_next_file (HANDLE h, find_data_type *findData)
 Advance a given file-system search.
static void find_close (HINTERNET hfind)
 Closes the file-search.
File-system state
static bool_type set_current_directory (HINTERNET hconn, char_type const *dir)
 Sets the current directory to dir.
static bool_type get_current_directory (HINTERNET hconn, size_t &cchBuffer, char_type *buffer)
 Retrieves the name of the current directory into buffer up to a maximum of cchBuffer characters.
static bool_type file_exists (HINTERNET hconn, char_type const *fileName)
 Returns whether a file exists or not.
static bool_type is_file (HINTERNET hconn, char_type const *path)
 Returns whether the given path represents a file.
static bool_type is_directory (HINTERNET hconn, char_type const *path)
 Returns whether the given path represents a directory.
static bool_type stat (HINTERNET hconn, char_type const *path, stat_data_type *stat_data)
 Gets the information for a particular file system entry.
static bool_type is_file (stat_data_type const *stat_data)
 Returns whether the given stat info represents a file.
static bool_type is_directory (stat_data_type const *stat_data)
 Returns whether the given stat info represents a directory.
static bool_type is_link (stat_data_type const *stat_data)
 Returns whether the given stat info represents a link.
static bool_type is_readonly (stat_data_type const *stat_data)
 Returns whether the given stat info represents a read-only entry.
File-system control
static bool_type create_directory (HINTERNET hconn, char_type const *dir)
 Creates a directory.
static bool_type remove_directory (HINTERNET hconn, char_type const *dir)
 Deletes a directory.
static bool_type delete_file (HINTERNET hconn, char_type const *file)
 Delete a file.
static bool_type rename_file (HINTERNET hconn, char_type const *currentName, char_type const *newName)
 Rename a file.

Member Typedef Documentation

typedef C char_type

The character type.

typedef size_t size_type

The size type.

typedef is_ptrdiff_t difference_type

The difference type.

typedef WIN32_FIND_DATA find_data_type

The find data type.

typedef WIN32_FIND_DATA stat_data_type

The stat data type.

The current instantion of the type.

typedef int int_type

The (signed) integer type.

typedef bool bool_type

The Boolean type.

typedef DWORD error_type

The type of system error codes.


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_t  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 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* ensure_dir_end ( char_type dir  )  [static]

Appends a path name separator to dir if one does not exist.

See also:
path_name_separator()

static char_type* remove_dir_end ( char_type dir  )  [static]

Removes the path name separator from the end of dir, if it has it.

See also:
path_name_separator()

static bool_type has_dir_end ( char_type const *  dir  )  [static]

Returns true if dir has trailing path name separator.

See also:
path_name_separator()

static bool_type is_dots ( char_type const *  dir  )  [static]

Returns true if dir is "." or "..".

static bool_type is_path_rooted ( char_type const *  path  )  [static]

Returns true if path is rooted.

static bool_type is_path_absolute ( char_type const *  path  )  [static]

Returns true if path is an absolute path.

static bool_type is_path_name_separator ( char_type  ch  )  [static]

Returns true if the character is a path-name separator.

Note:
Both / and \ are interpreted as a path name separator

static char_type path_separator (  )  [static]

Returns the path separator.

This is the separator that is used to separate multiple paths on the operating system. On UNIX it is ':'

static char_type path_name_separator (  )  [static]

Returns the path name separator.

This is the separator that is used to separate parts of a path on the operating system. On UNIX it is '/'

static char_type const* pattern_all (  )  [static]

Returns the wildcard pattern that represents all possible matches.

Note:
It is '*'

static size_type get_full_path_name ( HINTERNET  hconn,
char_type const *  fileName,
size_type  cchBuffer,
char_type buffer,
char_type **  ppFile 
) [static]

Gets the full path name into the given buffer, returning a pointer to the file-part.

static size_type get_full_path_name ( HINTERNET  hconn,
char_type const *  fileName,
size_type  cchBuffer,
char_type buffer 
) [static]

Gets the full path name into the given buffer.

static HINTERNET internet_open ( char_type const *  agent,
is_dword_t  accessType,
char_type const *  proxy,
char_type const *  proxyBypass,
is_dword_t  flags 
) [static]

Opens a WinInet session.

static HINTERNET internet_connect ( HINTERNET  hsess,
char_type const *  server,
INTERNET_PORT  port,
char_type const *  userName,
char_type const *  password,
is_dword_t  service,
is_dword_t  flags,
is_dword_t  context 
) [static]

Makes a connection to a FTP or HTTP site.

static void close_connection ( HINTERNET  hconn  )  [static]

Closes the connection to the FTP or HTTP site.

static HINTERNET find_first_file ( HINTERNET  hconn,
char_type const *  spec,
find_data_type findData,
is_dword_t  flags = 0,
is_dword_t  context = 0 
) [static]

Initiate a file-system search.

static bool_type find_next_file ( HANDLE  h,
find_data_type findData 
) [static]

Advance a given file-system search.

static void find_close ( HINTERNET  hfind  )  [static]

Closes the file-search.

static bool_type set_current_directory ( HINTERNET  hconn,
char_type const *  dir 
) [static]

Sets the current directory to dir.

static bool_type get_current_directory ( HINTERNET  hconn,
size_t &  cchBuffer,
char_type buffer 
) [static]

Retrieves the name of the current directory into buffer up to a maximum of cchBuffer characters.

static bool_type file_exists ( HINTERNET  hconn,
char_type const *  fileName 
) [static]

Returns whether a file exists or not.

static bool_type is_file ( HINTERNET  hconn,
char_type const *  path 
) [static]

Returns whether the given path represents a file.

static bool_type is_directory ( HINTERNET  hconn,
char_type const *  path 
) [static]

Returns whether the given path represents a directory.

static bool_type stat ( HINTERNET  hconn,
char_type const *  path,
stat_data_type stat_data 
) [static]

Gets the information for a particular file system entry.

static bool_type is_file ( stat_data_type const *  stat_data  )  [static]

Returns whether the given stat info represents a file.

static bool_type is_directory ( stat_data_type const *  stat_data  )  [static]

Returns whether the given stat info represents a directory.

static bool_type is_link ( stat_data_type const *  stat_data  )  [static]

Returns whether the given stat info represents a link.

static bool_type is_readonly ( stat_data_type const *  stat_data  )  [static]

Returns whether the given stat info represents a read-only entry.

static bool_type create_directory ( HINTERNET  hconn,
char_type const *  dir 
) [static]

Creates a directory.

static bool_type remove_directory ( HINTERNET  hconn,
char_type const *  dir 
) [static]

Deletes a directory.

static bool_type delete_file ( HINTERNET  hconn,
char_type const *  file 
) [static]

Delete a file.

static bool_type rename_file ( HINTERNET  hconn,
char_type const *  currentName,
char_type const *  newName 
) [static]

Rename a file.


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

Generated on Thu Jun 10 08:58:27 2010 for STLSoft by  doxygen 1.5.6