added option "-n" to read command for retrieving name/value pairs in numeric form, added numeric and verbose options to json, use null for unset values or replacement in json, allow passing raw value when writing name/value pairs, fix for numeric parsing of empty string

This commit is contained in:
john30
2015-06-04 13:04:38 +02:00
parent 1a87c46fde
commit 294c953c99
6 changed files with 125 additions and 113 deletions
+9 -9
View File
@@ -188,40 +188,40 @@ public:
* @param partType the @a PartType of the data.
* @param data the unescaped data @a SymbolString for reading binary data.
* @param output the @a ostringstream to append the formatted value to.
* @param outputFormat the @a OutputFormat options to use.
* @param leadingSeparator whether to prepend a separator before the formatted value.
* @param dataFormat the @a DataFormat to use.
* @param fieldName the optional name of a field to limit the output to.
* @param fieldIndex the optional index of the named field to limit the output to, or -1.
* @return @a RESULT_OK on success, or an error code.
*/
result_t decode(const PartType partType, SymbolString& data,
ostringstream& output, bool leadingSeparator=false,
DataFormat dataFormat=df_standard, const char* fieldName=NULL, signed char fieldIndex=-1);
ostringstream& output, OutputFormat outputFormat=0,
bool leadingSeparator=false, const char* fieldName=NULL, signed char fieldIndex=-1);
/**
* Decode all parts of a received message.
* @param masterData the unescaped master data @a SymbolString to decode.
* @param slaveData the unescaped slave data @a SymbolString to decode.
* @param output the @a ostringstream to append the formatted value to.
* @param outputFormat the @a OutputFormat options to use.
* @param leadingSeparator whether to prepend a separator before the formatted value.
* @param dataFormat the @a DataFormat to use.
* @return @a RESULT_OK on success, or an error code.
*/
result_t decode(SymbolString& masterData, SymbolString& slaveData,
ostringstream& output, bool leadingSeparator=false,
DataFormat dataFormat=df_standard);
ostringstream& output, OutputFormat outputFormat=0,
bool leadingSeparator=false);
/**
* Decode the value from the last stored data.
* @param output the @a ostringstream to append the formatted value to.
* @param outputFormat the @a OutputFormat options to use.
* @param leadingSeparator whether to prepend a separator before the formatted value.
* @param dataFormat the @a DataFormat to use.
* @param fieldName the optional name of a field to limit the output to.
* @param fieldIndex the optional index of the named field to limit the output to, or -1.
* @return @a RESULT_OK on success, or an error code.
*/
result_t decodeLastData(ostringstream& output, bool leadingSeparator=false,
DataFormat dataFormat=df_standard, const char* fieldName=NULL, signed char fieldIndex=-1);
result_t decodeLastData(ostringstream& output, OutputFormat outputFormat=0,
bool leadingSeparator=false, const char* fieldName=NULL, signed char fieldIndex=-1);
/**
* Get the last seen slave data.