Class FSNode
#include <FSNode.h >
Class to manage MAE virtual file system nodes.
DbRecNum id |
db table record id; 0 for empty record Default value: 0 |
Constructor with optional db table record id.
const HashArray& data |
key-value pairs with property names as keys |
Constructor with input from HashArray.
const string& text |
the key/value pairs as HashArray text |
Construct a FSNode from a string (output of toString())
Convert this instance to a string, which can later reconstruct this instance
Return value: a text string
Reset/Clear the contents of this instance
Determine if this instance has valid data or no.
Return value: true if valid; flase if not valid
Get the value of FSNode table id.
Return value: the value of id
Get the value of Parent directory node in FSNode.
Return value: the value of parentId
Get the value of Flag: true if this node is a directory; false otherwise.
Return value: the value of isDir
Get the value of Name of this node (without path).
Return value: the value of name
Get the value of Name of the spoke where the resource resides.
Return value: the value of spoke
Determine if this node is hosted by the root server, not a spoke
Return value: true if hosted by root server
Get the value of Actual filename in spoke's filesystem (if it's an acutal file)
Return value: the value of osfilename
Get the value of For a directory, it's MAE path (includes name).
Return value: the value of path
Get the value of Id from IORegistry table; 0 if not in registry.
Return value: the value of resourceId
Get the value of Last access time.
Return value: the value of atime
Get the value of Last modification time.
Return value: the value of mtime
Get the value of Resource owner; User record id.
Return value: the value of owner
Get the value of Accessibility, e.g. r, w, rw.
Return value: the value of access
string key |
the propery name to get (case insensitive) |
Given a FSNode single property name (key), return its value as a string.
Return value: the string equivalent of the property
DbRecNum newId |
the new id |
Set the node's id
DbRecNum newparentId |
the new value for parentId |
Set the value of Parent directory node in FSNode.
Return value: the updated instance of FSNode
bool newisDir |
the new value for isDir Default value: true |
Set the value of Flag: true if this node is a directory; false otherwise.
Return value: the updated instance of FSNode
const string& newname |
the new value for name |
Set the value of Name of this node (without path).
Return value: the updated instance of FSNode
const string& newspoke |
the new value for spoke |
Set the value of Name of the spoke where the resource resides.
Return value: the updated instance of FSNode
const string& newfilename |
the new value for osfilename |
Set the value of Actual filename in spoke's filesystem (if it's an acutal file)
Return value: the updated instance of FSNode
const string& newpath |
the new value for path |
Set the value of For a directory, it's MAE path (includes name).
Return value: the updated instance of FSNode
DbRecNum newresourceId |
the new value for resourceId |
Set the value of Id from IORegistry table; 0 if not in registry.
Return value: the updated instance of FSNode
time_t newatime |
the new value for atime |
Set the value of Last access time.
Return value: the updated instance of FSNode
time_t newmtime |
the new value for mtime |
Set the value of Last modification time.
Return value: the updated instance of FSNode
DbRecNum newowner |
the new value for owner |
Set the value of Resource owner; User record id.
Return value: the updated instance of FSNode
const string& newaccess |
the new value for access |
Set the value of Accessibility, e.g. r, w, rw.
Return value: the updated instance of FSNode
const HashArray& data |
the key/value pairs to set |
Given a set of FSNode properties in key-value pairs, initialize this instance with them.
This is complementary to toHashArray().
Return value: the initialized instance of FSNode
string key |
the propery name to set (case insensitive) |
const string& value |
a string equivalent to assign (it will be converted) |
Given a FSNode single property name (key) and a string value, assign the value to the property.
Return value: true upon success, false on failure (like invalid property name)
const HashArray& criteria |
key/value (field/value) pairs to find |
const string& sortby |
sort the resulting list by this field name Default value: "" |
Given field/value criteria, find matching record ids.
Return value: list of FSNode record ids matching the criteria
const string& criteria |
an expression of fields, comparators, parenthesis and logic ops |
const string& sortby |
sort the resulting list by this field name Default value: "" |
Given criteria expression, find matching record ids.
Return value: list of FSNode record ids matching the criteria
Get a list of all record ids.
Return value: the list of all record ids
const string& spoke |
the name of the spoke |
Get a list of all record ids for a specific spoke.
Return value: the list of all record ids for spoke
bool forDB |
false to include Id; true to exclude Id, which is handy for sending to Datastore Default value: false |
Convert this instance's data into a HashArray.
This is the complement of set()
Return value: a HashArray of instance's properties
bool forDB |
false to include Id; true to exclude Id, which is handy for sending to Datastore Default value: false |
Convert this instance's data to XML.
Return value: a XMLData of instance's properties
Save this record to the Datastore.
If the data has not changed, it is not saved.
Return value: the Id upon success, 0 on failure
Add a new record to the Datastore.
If the Id is set, it will be used; if 0, a new Id will be assigned.
Return value: the new record's record Id
Delete the record from the Datastore.
Return value: true if successfully deleted; false on error (like id==0 or DB error)
const HashArray& values |
key/value pairs for field assignments |
Add a new record to the Datastore.
If the Id field is set, it will be used; if 0, a new Id will be assigned.
Return value: the new record's record Id
const string& fspath |
the filesystem path on the current host OS |
Query the host OS filesystem for files and return them as vector.
Note the vector is not setting id, parentId, spoke, path, or resourceId,
only name and isDir.
Return value: a list of nodes (files and directories)
DbRecNum id |
the id of the record to load |
Load data from the Datastore with the provided Id.
Return value: true upon success; false upon faliure
DbRecNum id |
FSNode table id |
DbRecNum parentId |
Parent directory node in FSNode |
bool isDir |
Flag: true if this node is a directory; false otherwise |
string name |
Name of this node (without path) |
string spoke |
Name of the spoke where the resource resides |
string osfilename |
Actual filename in spoke's filesystem (if it's an acutal file) |
string path |
For a directory, it's MAE path (includes name) |
DbRecNum resourceId |
Id from IORegistry table; 0 if not in registry |
time_t atime |
Last access time |
time_t mtime |
Last modification time |
DbRecNum owner |
Resource owner; User record id |
string access |
Accessibility, e.g. r, w, rw |
string type |
Resource type |
long size |
Resource size in bytes, if known; -1 otherwise |
bool changed |
Flag: true if any data in this instance has changed |
static Datastore db |
Our connection to DB table data |
Make sure we're connected to our table in the Datastore
Return value: true upon success, false upon failure