libqalculate-5.3.0
|
A a data set object. More...
#include <DataSet.h>
Public Member Functions | |
DataObject (DataSet *parent_set) | |
void | eraseProperty (DataProperty *property) |
void | setProperty (DataProperty *property, std::string s_value, int is_approximate=-1) |
void | setNonlocalizedKeyProperty (DataProperty *property, std::string s_value) |
const MathStructure * | getPropertyStruct (DataProperty *property) |
const std::string & | getProperty (DataProperty *property, int *is_approximate=NULL) |
const std::string & | getNonlocalizedKeyProperty (DataProperty *property) |
std::string | getPropertyInputString (DataProperty *property) |
std::string | getPropertyDisplayString (DataProperty *property) |
bool | isUserModified () const |
void | setUserModified (bool user_modified=true) |
DataSet * | parentSet () const |
Protected Attributes | |
std::vector< DataProperty * > | properties |
std::vector< std::string > | s_properties |
std::vector< std::string > | s_nonlocalized_properties |
std::vector< MathStructure * > | m_properties |
std::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 std::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 std::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. |
std::string DataObject::getPropertyDisplayString | ( | DataProperty * | property | ) |
Returns value for a property in a format suitable for display with unit appended.
property | Property to read. |
std::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, |
std::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_value | Value for the property. |
void DataObject::setProperty | ( | DataProperty * | property, |
std::string | s_value, | ||
int | is_approximate = -1 ) |
Set value for a property.
property | Property to set (must belong to parent data set). |
s_value | 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. |