mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-23 17:33:56 +03:00
feature #523: New to_xml64 method for objects that generates a base64 encoded version of the object
This commit is contained in:
parent
2a508a112b
commit
5483a1ba92
@ -104,6 +104,14 @@ public:
|
||||
pthread_mutex_unlock(&mutex);
|
||||
};
|
||||
|
||||
/**
|
||||
* Function to print the object into a string in XML format
|
||||
* base64 encoded
|
||||
* @param xml the resulting XML string
|
||||
* @return a reference to the generated string
|
||||
*/
|
||||
virtual string& to_xml64(string &xml64);
|
||||
|
||||
/**
|
||||
* Function to print the object into a string in XML format
|
||||
* @param xml the resulting XML string
|
||||
|
@ -15,6 +15,25 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
#include "PoolObjectSQL.h"
|
||||
#include "SSLTools.h"
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
string& PoolObjectSQL::to_xml64(string &xml64)
|
||||
{
|
||||
string *str64;
|
||||
|
||||
to_xml(xml64);
|
||||
|
||||
str64 = SSLTools::base64_encode(xml64);
|
||||
|
||||
xml64 = *str64;
|
||||
|
||||
delete str64;
|
||||
|
||||
return xml64;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user