Wtx ~ Wt Extension Library
WtxLib
|
Client Folder. More...
#include <ClientFolder.h>
Public Member Functions | |
ClientFolder (int uid, const std::string &key, const std::string &name) | |
ClientFolder (const std::string &uid, const std::string &key, const std::string &name) | |
ClientFolder (const ClientFolder ©) | |
bool | isValid () const |
Is Valid. More... | |
const std::string & | uid () const |
Unique ID. More... | |
const std::string & | key () const |
Key Value. More... | |
const std::string & | name () const |
Name Value. More... | |
std::string | fileParent (const std::string &subFolder="") const |
File Parent. More... | |
std::string | filePath (const std::string &subFolder="") const |
File Path. More... | |
std::string | fileFolder (const std::string &subFolder="") const |
File Folder. More... | |
std::string | fileAbsolutePath (const std::string &subFolder="") const |
File Absolute Path. More... | |
std::string | fileId () const |
Field ID. More... | |
std::string | fileCode () const |
File Code. More... | |
std::string | fileName () const |
File Name. More... | |
std::string | fileKey () const |
File Key. More... | |
std::string | fileChar () const |
File Character. More... | |
std::string | fileRoot (const std::string &subFolder="") const |
File Root. More... | |
ClientFolder (int uid, const std::string &key, const std::string &name) | |
ClientFolder (const std::string &uid, const std::string &key, const std::string &name) | |
ClientFolder (const ClientFolder ©) | |
bool | isValid () const |
Is Valid. More... | |
const std::string & | uid () const |
Unique ID. More... | |
const std::string & | key () const |
Key Value. More... | |
const std::string & | name () const |
Name Value. More... | |
std::string | fileParent (const std::string &subFolder="") const |
File Parent. More... | |
std::string | filePath (const std::string &subFolder="") const |
File Path. More... | |
std::string | fileFolder (const std::string &subFolder="") const |
File Folder. More... | |
std::string | fileAbsolutePath (const std::string &subFolder="") const |
File Absolute Path. More... | |
std::string | fileId () const |
Field ID. More... | |
std::string | fileCode () const |
File Code. More... | |
std::string | fileName () const |
File Name. More... | |
std::string | fileKey () const |
File Key. More... | |
std::string | fileChar () const |
File Character. More... | |
std::string | fileRoot (const std::string &subFolder="") const |
File Root. More... | |
Static Public Member Functions | |
static void | setup (const std::string &rootPath, const std::string &idPrefix, int idLength, char idPadding, const std::string &idSuffix) |
Setup Global Static. More... | |
static std::string & | rootPath () |
Root Path. More... | |
static std::string & | idPrefix () |
ID Prefix. More... | |
static int | idLength () |
ID Length. More... | |
static std::string & | idSuffix () |
ID Suffix. More... | |
static char | idPadding () |
ID Padding. More... | |
static std::string | folder (const std::string &base, const std::string &sub) |
Folder. More... | |
static void | setup (const std::string &rootPath, const std::string &idPrefix, int idLength, char idPadding, const std::string &idSuffix) |
Setup Global Static. More... | |
static std::string & | rootPath () |
Root Path. More... | |
static std::string & | idPrefix () |
ID Prefix. More... | |
static int | idLength () |
ID Length. More... | |
static std::string & | idSuffix () |
ID Suffix. More... | |
static char | idPadding () |
ID Padding. More... | |
static std::string | folder (const std::string &base, const std::string &sub) |
Folder. More... | |
Client Folder.
This object encapsulates a handful of functions that can be used to manipulate and interact with client folders that are stored on disk somewhere.
What this object does is take some of the elements of the client file and construct some disk-compatible file-name strings. The reason we want these to be disk-compatible is we are going to make a client folder out of these values, and we don't want any funky characters in them.
This object also contains disk-folder manipulation functions for creating and maintaining client folders. Where this can be very useful is on a file-system where users have access to changing the folder names (they shouldn't, but sometimes they do) and these functions will locate client folders that have been renamed for some reason and will help in getting the names set back to what they should be.
The overall objective is to provide for a common disk-compatible client file naming system, that organizes disk-files in a similar manner to the database itself.
The result of constructing this object with the values above facilitates extracting the various folder properties, such as the root portion of the file path, and the various elements that make it all up.
This object encapsulates a handful of functions that can be used to manipulate and interact with client folders that are stored on disk somewhere.
What this object does is take some of the elements of the client file and construct some disk-compatible file-name strings. The reason we want these to be disk-compatible is we are going to make a client folder out of these values, and we don't want any funky characters in them.
This object also contains disk-folder manipulation functions for creating and maintaining client folders. Where this can be very useful is on a file-system where users have access to changing the folder names (they shouldn't, but sometimes they do) and these functions will locate client folders that have been renamed for some reason and will help in getting the names set back to what they should be.
The overall objective is to provide for a common disk-compatible client file naming system, that organizes disk-files in a similar manner to the database itself.
The result of constructing this object with the values above facilitates extracting the various folder properties, such as the root portion of the file path, and the various elements that make it all up.
Definition at line 228 of file ClientFolder.h.
std::string Wtx::ClientFolder::fileAbsolutePath | ( | const std::string & | subFolder = "" | ) | const |
File Absolute Path.
This is the client folder absolute path. This includes everything up to the end of the folder (without the appended '/' forward slash. As a matter of convenience a subFolder parameter can be provided, and it will be appended with a '/' slash-separator
std::string Wtx::ClientFolder::fileAbsolutePath | ( | const std::string & | subFolder = "" | ) | const |
File Absolute Path.
This is the client folder absolute path. This includes everything up to the end of the folder (without the appended '/' forward slash. As a matter of convenience a subFolder parameter can be provided, and it will be appended with a '/' slash-separator
Definition at line 300 of file ClientFolder.cpp.
std::string Wtx::ClientFolder::fileChar | ( | ) | const |
File Character.
This is the File single-letter character
std::string Wtx::ClientFolder::fileChar | ( | ) | const |
File Character.
This is the File single-letter character
Definition at line 382 of file ClientFolder.cpp.
std::string Wtx::ClientFolder::fileCode | ( | ) | const |
File Code.
This is the portion of the client folder that contains the prefix formatted ID and suffix.
std::string Wtx::ClientFolder::fileCode | ( | ) | const |
File Code.
This is the portion of the client folder that contains the prefix formatted ID and suffix.
Definition at line 338 of file ClientFolder.cpp.
std::string Wtx::ClientFolder::fileFolder | ( | const std::string & | subFolder = "" | ) | const |
File Folder.
This is the portion of the folder that is ~only~ the elements that include only the client info. This does not include the single-character group folder.
std::string Wtx::ClientFolder::fileFolder | ( | const std::string & | subFolder = "" | ) | const |
File Folder.
This is the portion of the folder that is ~only~ the elements that include only the client info. This does not include the single-character group folder.
Definition at line 275 of file ClientFolder.cpp.
std::string Wtx::ClientFolder::fileId | ( | ) | const |
Field ID.
The Formatted File ID
std::string Wtx::ClientFolder::fileId | ( | ) | const |
std::string Wtx::ClientFolder::fileKey | ( | ) | const |
File Key.
This is the reformatted File Key.
std::string Wtx::ClientFolder::fileKey | ( | ) | const |
std::string Wtx::ClientFolder::fileName | ( | ) | const |
File Name.
This is the reformatted File Name.
std::string Wtx::ClientFolder::fileName | ( | ) | const |
std::string Wtx::ClientFolder::fileParent | ( | const std::string & | subFolder = "" | ) | const |
File Parent.
This is the parent portion of the folder path. This value includes the single-letter value that identifies the root element to where the client folder is going to exist. It is possible to provide a sub-folder element to this call and it will be appended to the return value as a convenience feature.
std::string Wtx::ClientFolder::fileParent | ( | const std::string & | subFolder = "" | ) | const |
File Parent.
This is the parent portion of the folder path. This value includes the single-letter value that identifies the root element to where the client folder is going to exist. It is possible to provide a sub-folder element to this call and it will be appended to the return value as a convenience feature.
Definition at line 229 of file ClientFolder.cpp.
std::string Wtx::ClientFolder::filePath | ( | const std::string & | subFolder = "" | ) | const |
File Path.
This is the client sub folder element of the client folder. This value also includes the single-character group folder.
std::string Wtx::ClientFolder::filePath | ( | const std::string & | subFolder = "" | ) | const |
File Path.
This is the client sub folder element of the client folder. This value also includes the single-character group folder.
Definition at line 252 of file ClientFolder.cpp.
std::string Wtx::ClientFolder::fileRoot | ( | const std::string & | subFolder = "" | ) | const |
File Root.
This is the root folder. This allows for a sub-folder to be passed in, and this function will insure it is appended properly.
std::string Wtx::ClientFolder::fileRoot | ( | const std::string & | subFolder = "" | ) | const |
File Root.
This is the root folder. This allows for a sub-folder to be passed in, and this function will insure it is appended properly.
Definition at line 393 of file ClientFolder.cpp.
|
static |
Folder.
This is an internal function that is used to append one string to another with the '/' delimiter.
|
static |
Folder.
This is an internal function that is used to append one string to another with the '/' delimiter.
Definition at line 115 of file ClientFolder.cpp.
|
static |
ID Length.
This determines how many characters the ID value should occupy. When the resulting ID value is short, it is padded to reach this length.
|
static |
ID Length.
This determines how many characters the ID value should occupy. When the resulting ID value is short, it is padded to reach this length.
Definition at line 151 of file ClientFolder.cpp.
|
static |
ID Padding.
This is the single-character that is used to pad the ID value when it is shorted than the idLength().
|
static |
ID Padding.
This is the single-character that is used to pad the ID value when it is shorted than the idLength().
Definition at line 162 of file ClientFolder.cpp.
|
static |
ID Prefix.
This string value is placed in the front of the ID string.
|
static |
ID Prefix.
This string value is placed in the front of the ID string.
Definition at line 140 of file ClientFolder.cpp.
|
static |
ID Suffix.
This string value is placed immediately after the ID string.
|
static |
ID Suffix.
This string value is placed immediately after the ID string.
Definition at line 173 of file ClientFolder.cpp.
bool Wtx::ClientFolder::isValid | ( | ) | const |
Is Valid.
This indicates .true. when the object has been properly initialized by the proper constructor.
bool Wtx::ClientFolder::isValid | ( | ) | const |
Is Valid.
This indicates .true. when the object has been properly initialized by the proper constructor.
Definition at line 185 of file ClientFolder.cpp.
const std::string& Wtx::ClientFolder::key | ( | ) | const |
Key Value.
This is the original KEY value that was provided by the caller.
const std::string & Wtx::ClientFolder::key | ( | ) | const |
Key Value.
This is the original KEY value that was provided by the caller.
Definition at line 207 of file ClientFolder.cpp.
const std::string& Wtx::ClientFolder::name | ( | ) | const |
Name Value.
This is the orignial NAME value that was provided by the caller.
const std::string & Wtx::ClientFolder::name | ( | ) | const |
Name Value.
This is the orignial NAME value that was provided by the caller.
Definition at line 218 of file ClientFolder.cpp.
|
static |
Root Path.
This returns the static value to the root path of the file system.
|
static |
Root Path.
This returns the static value to the root path of the file system.
Definition at line 129 of file ClientFolder.cpp.
|
static |
Setup Global Static.
This functions sets up the global settings for this object. This function should be called at the start of program launch, perhaps in the main() function. Once set, these values will be used by all instances of the object.
rootPath | Base Path to the point where client char folders will be created. This path should ~not~ end with a '/' (forward slash) character... the folder separator '/' gets added as needed as the object is called upon. Remember that this object uses real simple string manipulation, and does not search for things like '//' in the middle of the string, so pay attention to what's being sent to the rootPath. |
idPrefix | String of characters that are prepended to the client 'ID' value. This setting helps force a fixed-known set of characters that appear immediately in front of the ID value such that in the event that the folder is accidently renamed that it can be relocated. The flip side of this issue is if the client itself is renamed, then any client folders that were previously created need to be renamed to match. By providing an ID-Prefix to the file name, it becomes possible to scan the client folders for the encoded ID value, and rename the folder to properly match what's in the database. |
idLength | It is possible to control the overall length of the client ID that is represented on the disk folder. This value, used in conjunction with the 'padding' value causes the ID to be padded and filled to match this length. |
idPadding | This is a single padding character that is used to fill ID numbers. |
idSuffix | This value follows the ID value. The combination of idPrefix() and the idSuffix() improves the ability to identify disconnected and misnamed file folders. |
|
static |
Setup Global Static.
This functions sets up the global settings for this object. This function should be called at the start of program launch, perhaps in the main() function. Once set, these values will be used by all instances of the object.
rootPath | Base Path to the point where client char folders will be created. This path should ~not~ end with a '/' (forward slash) character... the folder separator '/' gets added as needed as the object is called upon. Remember that this object uses real simple string manipulation, and does not search for things like '//' in the middle of the string, so pay attention to what's being sent to the rootPath. |
idPrefix | String of characters that are prepended to the client 'ID' value. This setting helps force a fixed-known set of characters that appear immediately in front of the ID value such that in the event that the folder is accidently renamed that it can be relocated. The flip side of this issue is if the client itself is renamed, then any client folders that were previously created need to be renamed to match. By providing an ID-Prefix to the file name, it becomes possible to scan the client folders for the encoded ID value, and rename the folder to properly match what's in the database. |
idLength | It is possible to control the overall length of the client ID that is represented on the disk folder. This value, used in conjunction with the 'padding' value causes the ID to be padded and filled to match this length. |
idPadding | This is a single padding character that is used to fill ID numbers. |
idSuffix | This value follows the ID value. The combination of idPrefix() and the idSuffix() improves the ability to identify disconnected and misnamed file folders. |
Definition at line 89 of file ClientFolder.cpp.
const std::string& Wtx::ClientFolder::uid | ( | ) | const |
Unique ID.
This is a string representation of the ID value that was provided by the constructor.
const std::string & Wtx::ClientFolder::uid | ( | ) | const |
Unique ID.
This is a string representation of the ID value that was provided by the constructor.
Definition at line 196 of file ClientFolder.cpp.