|
virtual int | _invokeValueCallback (string value) |
|
virtual string | download (string pathname) |
|
virtual bool | fileExist (string filename) |
|
int | filesCount (void) |
|
virtual int | format_fs (void) |
|
int | freeSpace (void) |
|
int | get_filesCount (void) |
|
int | get_freeSpace (void) |
|
virtual vector< YFileRecord > | get_list (string pattern) |
|
YFiles * | next (void) |
|
YFiles * | nextFiles (void) |
|
virtual int | registerValueCallback (YFilesValueCallback callback) |
|
virtual int | remove (string pathname) |
|
virtual string | sendCommand (string command) |
|
virtual int | upload (string pathname, string content) |
|
| ~YFiles () |
|
void | _clearDataStreamCache () |
|
string | _decode_json_string (const string &json) |
|
string | _download (const string &url) |
|
YDataStream * | _findDataStream (YDataSet &dataset, const string &def) |
|
string | _get_json_path (const string &json, const string &path) |
|
vector< string > | _json_get_array (const string &json) |
|
string | _json_get_key (const string &json, const string &data) |
|
string | _json_get_string (const string &json) |
|
int | _parseEx (yJsonStateMachine &j) |
|
virtual int | _parserHelper (void) |
|
string | _parseString (yJsonStateMachine &j) |
|
string | _request (const string &request) |
|
string | _requestEx (int tcpchan, const string &request, yapiRequestProgressCallback callback, void *context) |
|
void | _throw (YRETCODE errType, string errMsg) |
|
YRETCODE | _upload (const string &path, const string &content) |
|
YRETCODE | _uploadWithProgress (const string &path, const string &content, yapiRequestProgressCallback callback, void *context) |
|
string | advertisedValue (void) |
|
void | clearCache () |
|
string | describe (void) |
|
string | errMessage (void) |
|
string | errorMessage (void) |
|
YRETCODE | errorType (void) |
|
YRETCODE | errType (void) |
|
YFUN_DESCR | functionDescriptor (void) |
|
string | get_advertisedValue (void) |
|
string | get_errorMessage (void) |
|
YRETCODE | get_errorType (void) |
|
virtual string | get_friendlyName (void) |
|
YFUN_DESCR | get_functionDescriptor (void) |
|
string | get_functionId (void) |
|
string | get_hardwareId (void) |
|
string | get_hubSerial () |
|
string | get_logicalName (void) |
|
YModule * | get_module (void) |
|
void * | get_userData (void) |
|
bool | isOnline (void) |
|
YRETCODE | load (int msValidity) |
|
virtual string | loadAttribute (string attrName) |
|
string | logicalName (void) |
|
YModule * | module (void) |
|
virtual int | muteValueCallbacks (void) |
|
YFunction * | next (void) |
|
YFunction * | nextFunction (void) |
|
virtual int | registerValueCallback (YFunctionValueCallback callback) |
|
int | set_advertisedValue (const string &newval) |
|
int | set_logicalName (const string &newval) |
|
void | set_userData (void *data) |
|
int | setAdvertisedValue (const string &newval) |
|
int | setLogicalName (const string &newval) |
|
void | setUserData (void *data) |
|
virtual int | unmuteValueCallbacks (void) |
|
void * | userData (void) |
|
virtual | ~YFunction () |
|
|
YRETCODE | _buildSetRequest (const string &changeattr, const string *changeval, string &request, string &errmsg) |
|
string | _escapeAttr (const string &changeval) |
|
YRETCODE | _getDescriptor (YFUN_DESCR &fundescr, string &errMsg) |
|
YRETCODE | _getDevice (YDevice *&dev, string &errMsg) |
|
YRETCODE | _load_unsafe (int msValidity) |
|
YRETCODE | _nextFunction (string &hwId) |
|
int | _parse (YJSONObject *j) |
|
YRETCODE | _setAttr (string attrname, string newvalue) |
|
| YFunction (const string &func) |
|
static void | _AddToCache (const string &classname, const string &func, YFunction *obj) |
|
static YFunction * | _FindFromCache (const string &classname, const string &func) |
|
static void | _UpdateTimedReportCallbackList (YFunction *func, bool add) |
|
static void | _UpdateValueCallbackList (YFunction *func, bool add) |
|
string | _advertisedValue |
|
u64 | _cacheExpiration |
|
string | _className |
|
std::map< string, YDataStream * > | _dataStreams |
|
string | _func |
|
YFUN_DESCR | _fundescr |
|
string | _funId |
|
string | _hwId |
|
string | _lastErrorMsg |
|
YRETCODE | _lastErrorType |
|
string | _logicalName |
|
string | _serial |
|
yCRITICAL_SECTION | _this_cs |
|
void * | _userData |
|
YFunctionValueCallback | _valueCallbackFunction |
|
static std::map< string, YFunction * > | _cache |
|
YFiles Class: Files function interface
The filesystem interface makes it possible to store files on some devices, for instance to design a custom web UI (for networked devices) or to add fonts (on display devices).
Definition at line 115 of file yocto_files.h.
YFiles * YFiles::FindFiles |
( |
string |
func | ) |
|
|
static |
Retrieves a filesystem for a given identifier. The identifier can be specified using several formats:
-
FunctionLogicalName
-
ModuleSerialNumber.FunctionIdentifier
-
ModuleSerialNumber.FunctionLogicalName
-
ModuleLogicalName.FunctionIdentifier
-
ModuleLogicalName.FunctionLogicalName
This function does not require that the filesystem is online at the time it is invoked. The returned object is nevertheless valid. Use the method YFiles.isOnline() to test if the filesystem is indeed online at a given time. In case of ambiguity when looking for a filesystem by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.
If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.
- Parameters
-
func | : a string that uniquely characterizes the filesystem |
- Returns
- a YFiles object allowing you to drive the filesystem.
Definition at line 231 of file yocto_files.cpp.
int YFiles::format_fs |
( |
void |
| ) |
|
|
virtual |
Reinitialize the filesystem to its clean, unfragmented, empty state. All files previously uploaded are permanently lost.
- Returns
- YAPI_SUCCESS if the call succeeds.
On failure, throws an exception or returns a negative error code.
Definition at line 308 of file yocto_files.cpp.
int YFiles::remove |
( |
string |
pathname | ) |
|
|
virtual |
Deletes a file, given by its full path name, from the filesystem. Because of filesystem fragmentation, deleting a file may not always free up the whole space used by the file. However, rewriting a file with the same path name will always reuse any space not freed previously. If you need to ensure that no space is taken by previously deleted files, you can use format_fs to fully reinitialize the filesystem.
- Parameters
-
pathname | : path and name of the file to remove. |
- Returns
- YAPI_SUCCESS if the call succeeds.
On failure, throws an exception or returns a negative error code.
Definition at line 416 of file yocto_files.cpp.
int YFiles::upload |
( |
string |
pathname, |
|
|
string |
content |
|
) |
| |
|
virtual |
Uploads a file to the filesystem, to the specified full path name. If a file already exists with the same path name, its content is overwritten.
- Parameters
-
pathname | : path and name of the new file to create |
content | : binary buffer with the content to set |
- Returns
- YAPI_SUCCESS if the call succeeds.
On failure, throws an exception or returns a negative error code.
Definition at line 397 of file yocto_files.cpp.
YFiles* yFindFiles |
( |
const string & |
func | ) |
|
|
friend |
Retrieves a filesystem for a given identifier. The identifier can be specified using several formats:
-
FunctionLogicalName
-
ModuleSerialNumber.FunctionIdentifier
-
ModuleSerialNumber.FunctionLogicalName
-
ModuleLogicalName.FunctionIdentifier
-
ModuleLogicalName.FunctionLogicalName
This function does not require that the filesystem is online at the time it is invoked. The returned object is nevertheless valid. Use the method YFiles.isOnline() to test if the filesystem is indeed online at a given time. In case of ambiguity when looking for a filesystem by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.
If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.
- Parameters
-
func | : a string that uniquely characterizes the filesystem |
- Returns
- a YFiles object allowing you to drive the filesystem.
Definition at line 355 of file yocto_files.h.