1
0
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:
Ruben S. Montero 2011-05-13 00:47:21 +02:00
parent 2a508a112b
commit 5483a1ba92
2 changed files with 27 additions and 0 deletions

View File

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

View File

@ -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;
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */