libqalculate-0.9.8
|
A a data set object. More...
#include <DataSet.h>
Public Member Functions | |
DataObject (DataSet *parent_set) | |
void | eraseProperty (DataProperty *property) |
void | setProperty (DataProperty *property, string s_value, int is_approximate=-1) |
void | setNonlocalizedKeyProperty (DataProperty *property, string s_value) |
const MathStructure * | getPropertyStruct (DataProperty *property) |
const string & | getProperty (DataProperty *property, int *is_approximate=NULL) |
const string & | getNonlocalizedKeyProperty (DataProperty *property) |
string | getPropertyInputString (DataProperty *property) |
string | getPropertyDisplayString (DataProperty *property) |
bool | isUserModified () const |
void | setUserModified (bool user_modified=true) |
DataSet * | parentSet () const |
Protected Attributes | |
vector< DataProperty * > | properties |
vector< string > | s_properties |
vector< string > | s_nonlocalized_properties |
vector< MathStructure * > | m_properties |
vector< int > | a_properties |
DataSet * | parent |
bool | b_uchanged |
A a data set object.
Data objects consist of property-value pairs.
DataObject::DataObject | ( | DataSet * | parent_set | ) |
Create a data object.
parent_set | Data set that the object will belong to. |
void DataObject::eraseProperty | ( | DataProperty * | property | ) |
Unset (erase value) a property.
property | Property to unset. |
const string& DataObject::getNonlocalizedKeyProperty | ( | DataProperty * | property | ) |
Returns unparsed untranslated value for a key property. Used when a text value is translated, but the original value still is needed as a reference key.
property | Property to read. |
const string& DataObject::getProperty | ( | DataProperty * | property, |
int * | is_approximate = NULL |
||
) |
Returns unparsed value for a property.
property | Property to read. | |
[out] | is_approximate | If the value is approximate. Is set to 1 for approximate, 0 for exact, -1 for property default, if not NULL. |
string DataObject::getPropertyDisplayString | ( | DataProperty * | property | ) |
Returns value for a property in a format suitable for display with unit appended.
property | Property to read. |
string DataObject::getPropertyInputString | ( | DataProperty * | property | ) |
Returns value for a property in a format suitable for use in expressions with unit appended.
property | Property to read. |
const MathStructure* DataObject::getPropertyStruct | ( | DataProperty * | property | ) |
Returns parsed value for a property. Parses the text string value if not parsed before
property | Property to read. |
bool DataObject::isUserModified | ( | ) | const |
If the object has been modified by the end user (if setUserModified() has been called).
DataSet* DataObject::parentSet | ( | ) | const |
Returns the data set that the object belongs to.
void DataObject::setNonlocalizedKeyProperty | ( | DataProperty * | property, |
string | s_value | ||
) |
Set an untranslated value for a key property. Used when a text value is translated, but the original value still is needed as a reference key.
property | Property to set (must belong to parent data set). |
s_vale | Value for the property. |
void DataObject::setProperty | ( | DataProperty * | property, |
string | s_value, | ||
int | is_approximate = -1 |
||
) |
Set value for a property.
property | Property to set (must belong to parent data set). |
s_vale | Value for the property. |
is_approximate | If the value is approximate. 1 for approximate, 0 for exact, -1 for property default. |
void DataObject::setUserModified | ( | bool | user_modified = true | ) |
Specify if the object has been modified by the end user.
user_modified | true if the object has been modified by the user. |