# DataObject Class Reference

A a data set object. More...

`#include <DataSet.h>`

List of all members.

## 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

## Detailed Description

A a data set object.

Data objects consist of property-value pairs.

## Constructor & Destructor Documentation

DataObject::DataObject | ( | DataSet * | parent_set | ) |

Create a data object.

Parameters:

  | parent_set | Data set that the object will belong to.

## Member Function Documentation

void DataObject::eraseProperty | ( | DataProperty * | property | ) |

Unset (erase value) a property.

Parameters:

  | property | Property to unset.

void DataObject::setProperty | ( | DataProperty * | property,
|  | string | s_value,
|  | int | is_approximate = `-1` |
| ) |  |  |

Set value for a property.

Parameters:

  | 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::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.

Parameters:

  | property | Property to set (must belong to parent data set).
  | s_vale | Value for the property.

const MathStructure* DataObject::getPropertyStruct | ( | DataProperty * | property | ) |

Returns parsed value for a property. Parses the text string value if not parsed before

Parameters:

  | property | Property to read.

Returns:
  Parsed value or NULL if property value is not set.

const string& DataObject::getProperty | ( | DataProperty * | property,
|  | int * | is_approximate = `NULL` |
| ) |  |  |

Returns unparsed value for a property.

Parameters:

  | 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.

Returns:
  Unparsed value or empty string if property value is not set.

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.

Parameters:

  | property | Property to read.

Returns:
  Unparsed untranslated value or empty string if property value is not set.

string DataObject::getPropertyInputString | ( | DataProperty * | property | ) |

Returns value for a property in a format suitable for use in expressions with unit appended.

Parameters:

  | property | Property to read.

Returns:
  Value in input format or empty string if property value is not set.

string DataObject::getPropertyDisplayString | ( | DataProperty * | property | ) |

Returns value for a property in a format suitable for display with unit appended.

Parameters:

  | property | Property to read.

Returns:
  Value in display format or empty string if property value is not set.

bool DataObject::isUserModified | ( |  | ) | const

If the object has been modified by the end user (if setUserModified() has been called).

Returns:
  true if the object has been modified by the user.

void DataObject::setUserModified | ( | bool | user_modified = `true` | ) |

Specify if the object has been modified by the end user.

Parameters:

  | user_modified | true if the object has been modified by the user.

DataSet* DataObject::parentSet | ( |  | ) | const

Returns the data set that the object belongs to.

Returns:
  Parent data set.

The documentation for this class was generated from the following file:

- libqalculate/DataSet.h