#include <XMLwrapper.h>
|
| | XMLwrapper () |
| | ~XMLwrapper () |
| int | saveXMLfile (const std::string &filename, int compression) const |
| char * | getXMLdata () const |
| void | addpar (const std::string &name, int val) |
| void | addparreal (const std::string &name, float val) |
| void | addparbool (const std::string &name, int val) |
| void | addparstr (const std::string &name, const std::string &val) |
| void | beginbranch (const std::string &name) |
| void | beginbranch (const std::string &name, int id) |
| void | endbranch () |
| int | loadXMLfile (const std::string &filename) |
| bool | putXMLdata (const char *xmldata) |
| int | enterbranch (const std::string &name) |
| int | enterbranch (const std::string &name, int id) |
| void | exitbranch () |
| int | getbranchid (int min, int max) const |
| int | getpar (const std::string &name, int defaultpar, int min, int max) const |
| int | getpar127 (const std::string &name, int defaultpar) const |
| int | getparbool (const std::string &name, int defaultpar) const |
| void | getparstr (const std::string &name, char *par, int maxstrlen) const |
| std::string | getparstr (const std::string &name, const std::string &defaultpar) const |
| float | getparreal (const char *name, float defaultpar) const |
| float | getparreal (const char *name, float defaultpar, float min, float max) const |
| void | setPadSynth (bool enabled) |
| bool | hasPadSynth () const |
| void | add (const XmlNode &node) |
| std::vector< XmlNode > | getBranch (void) const |
| const version_type & | fileversion () const |
◆ XMLwrapper()
| XMLwrapper::XMLwrapper |
( |
| ) |
|
Constructor. Will Construct the object and fill in top level branch
◆ ~XMLwrapper()
| XMLwrapper::~XMLwrapper |
( |
| ) |
|
◆ add()
◆ addpar()
| void XMLwrapper::addpar |
( |
const std::string & | name, |
|
|
int | val ) |
Add simple parameter.
- Parameters
-
| name | The name of the mXML node. |
| val | The string value of the mXml node |
◆ addparams()
| mxml_node_t * XMLwrapper::addparams |
( |
const char * | name, |
|
|
unsigned int | params, |
|
|
| ... ) const |
|
private |
Create mxml_node_t with specified name and parameters
Results should look like: <name optionalParam1="value1" optionalParam2="value2" ...>
- Parameters
-
| name | The name of the xml node |
| params | The number of the attributes |
| ... | const char * pairs that are in the format attribute_name, attribute_value |
Private members
- Todo
- make this function send out a good error message if something goes wrong
◆ addparbool()
| void XMLwrapper::addparbool |
( |
const std::string & | name, |
|
|
int | val ) |
Add boolean parameter.
- Todo
- Fix this reverse boolean logic.
- Parameters
-
| name | The name of the mXML node. |
| val | The boolean value of the node (0->"yes";else->"no"). |
◆ addparreal()
| void XMLwrapper::addparreal |
( |
const std::string & | name, |
|
|
float | val ) |
Adds a realtype parameter.
- Parameters
-
| name | The name of the mXML node. |
| val | The float value of the node. |
◆ addparstr()
| void XMLwrapper::addparstr |
( |
const std::string & | name, |
|
|
const std::string & | val ) |
Add string parameter.
- Parameters
-
| name | The name of the mXML node. |
| val | The string value of the node. |
◆ beginbranch() [1/2]
| void zyncarla::XMLwrapper::beginbranch |
( |
const std::string & | name | ) |
|
◆ beginbranch() [2/2]
| void zyncarla::XMLwrapper::beginbranch |
( |
const std::string & | name, |
|
|
int | id ) |
Create a new branch.
- Parameters
-
| name | Name of new branch |
| id | "id" value of branch |
- See also
- void endbranch()
◆ cleanup()
| void zyncarla::XMLwrapper::cleanup |
( |
void | | ) |
|
|
private |
Cleanup XML tree before loading new one.
◆ doloadfile()
| char * XMLwrapper::doloadfile |
( |
const std::string & | filename | ) |
const |
|
private |
Loads specified file and returns data.
Will load a gziped file or an uncompressed file.
- Parameters
-
- Returns
- The decompressed data
◆ dosavefile()
| int XMLwrapper::dosavefile |
( |
const char * | filename, |
|
|
int | compression, |
|
|
const char * | xmldata ) const |
|
private |
Save the file.
- Parameters
-
◆ endbranch()
| void XMLwrapper::endbranch |
( |
| ) |
|
◆ enterbranch() [1/2]
| int zyncarla::XMLwrapper::enterbranch |
( |
const std::string & | name | ) |
|
Enters the branch.
- Parameters
-
- Returns
- 1 if is ok, or 0 otherwise.
◆ enterbranch() [2/2]
| int zyncarla::XMLwrapper::enterbranch |
( |
const std::string & | name, |
|
|
int | id ) |
Enter into the branch name with id id.
- Parameters
-
| name | Name of branch. |
| id | Value of branch's "id". |
- Returns
- 1 if is ok, or 0 otherwise.
◆ exitbranch()
| void XMLwrapper::exitbranch |
( |
| ) |
|
◆ fileversion()
◆ getBranch()
| std::vector< XmlNode > zyncarla::XMLwrapper::getBranch |
( |
void | | ) |
const |
◆ getbranchid()
| int XMLwrapper::getbranchid |
( |
int | min, |
|
|
int | max ) const |
Get the the branch_id and limits it between the min and max. if min==max==0, it will not limit it if there isn't any id, will return min this must be called only imediately after enterbranch()
◆ getpar()
| int XMLwrapper::getpar |
( |
const std::string & | name, |
|
|
int | defaultpar, |
|
|
int | min, |
|
|
int | max ) const |
Returns the integer value stored in node name. It returns the integer value between the limits min and max. If min==max==0, then the value will not be limited. If there is no location named name, then defaultpar will be returned.
- Parameters
-
| name | The parameter name. |
| defaultpar | The default value if the real value is not found. |
| min | The minimum return value. |
| max | The maximum return value. |
◆ getpar127()
| int XMLwrapper::getpar127 |
( |
const std::string & | name, |
|
|
int | defaultpar ) const |
Returns the integer value stored in the node with range [0,127].
- Parameters
-
| name | The parameter name. |
| defaultpar | The default value if the real value is not found. |
◆ getparbool()
| int XMLwrapper::getparbool |
( |
const std::string & | name, |
|
|
int | defaultpar ) const |
Returns the boolean value stored in the node.
- Parameters
-
| name | The parameter name. |
| defaultpar | The default value if the real value is not found. |
◆ getparreal() [1/2]
| float XMLwrapper::getparreal |
( |
const char * | name, |
|
|
float | defaultpar ) const |
Returns the real value stored in the node.
- Parameters
-
| name | The parameter name. |
| defaultpar | The default value if the real value is not found. |
◆ getparreal() [2/2]
| float XMLwrapper::getparreal |
( |
const char * | name, |
|
|
float | defaultpar, |
|
|
float | min, |
|
|
float | max ) const |
Returns the real value stored in the node.
- Parameters
-
| name | The parameter name. |
| defaultpar | The default value if the real value is not found. |
| min | The minimum value |
| max | The maximum value |
◆ getparstr() [1/2]
| void zyncarla::XMLwrapper::getparstr |
( |
const std::string & | name, |
|
|
char * | par, |
|
|
int | maxstrlen ) const |
Get the string value stored in the node.
- Parameters
-
| name | The parameter name. |
| par | Pointer to destination string |
| maxstrlen | Max string length for destination |
◆ getparstr() [2/2]
| std::string zyncarla::XMLwrapper::getparstr |
( |
const std::string & | name, |
|
|
const std::string & | defaultpar ) const |
Get the string value stored in the node.
- Parameters
-
| name | The parameter name. |
| defaultpar | The default value if the real value is not found. |
◆ getXMLdata()
| char * XMLwrapper::getXMLdata |
( |
| ) |
const |
Return XML tree as a string. Note: The string must be freed with free() to deallocate
- Returns
- a newly allocated NULL terminated string of the XML data.
◆ hasPadSynth()
| bool XMLwrapper::hasPadSynth |
( |
| ) |
const |
Checks the current tree for PADsynth usage
Right now this has a copied implementation of setparbool, so this should be reworked as XMLwrapper evolves
◆ loadXMLfile()
| int XMLwrapper::loadXMLfile |
( |
const std::string & | filename | ) |
|
Loads file into XMLwrapper.
- Parameters
-
- Returns
- 0 if ok or -1 if the file cannot be loaded
◆ putXMLdata()
| bool XMLwrapper::putXMLdata |
( |
const char * | xmldata | ) |
|
Loads string into XMLwrapper.
- Parameters
-
| xmldata | NULL terminated string of XML data. |
- Returns
- true if successful.
◆ saveXMLfile()
| int XMLwrapper::saveXMLfile |
( |
const std::string & | filename, |
|
|
int | compression ) const |
Saves the XML to a file.
- Parameters
-
| filename | the name of the destination file. |
- Returns
- 0 if ok or -1 if the file cannot be saved.
◆ setPadSynth()
| void XMLwrapper::setPadSynth |
( |
bool | enabled | ) |
|
Sets the current tree's PAD Synth usage
- Bug
- this might create multiple nodes when only one is needed
◆ _fileversion
◆ info
| mxml_node_t* zyncarla::XMLwrapper::info |
|
private |
Node used to store the information about the data
◆ minimal
| bool zyncarla::XMLwrapper::minimal |
false if all parameters will be stored (used only for clipboard)
◆ node
| mxml_node_t* zyncarla::XMLwrapper::node |
|
private |
current subtree in parsing or writing
◆ root
| mxml_node_t* zyncarla::XMLwrapper::root |
|
private |
xml data used by zynaddsubfx
◆ tree
| mxml_node_t* zyncarla::XMLwrapper::tree |
|
private |
The documentation for this class was generated from the following files:
- /home/runner/work/lmms-fork/lmms-fork/plugins/CarlaBase/carla/source/native-plugins/external/zynaddsubfx/Misc/XMLwrapper.h
- /home/runner/work/lmms-fork/lmms-fork/plugins/CarlaBase/carla/source/native-plugins/external/zynaddsubfx/Misc/XMLwrapper.cpp
- /home/runner/work/lmms-fork/lmms-fork/plugins/ZynAddSubFx/zynaddsubfx/src/Misc/XMLwrapper.cpp