#include <sol.h>
Public Member Functions | |
SOL () | |
~SOL () | |
size_t | size () const |
Get the number of Elements in this class. | |
size_t | fileSize () const |
bool | extractHeader (const std::vector< boost::uint8_t > &data) |
Extract the header from the file. | |
bool | extractHeader (const std::string &filespec) |
Extract the header from the file. | |
bool | formatHeader (const std::vector< boost::uint8_t > &data) |
Create the file header. | |
bool | formatHeader (const std::string &name) |
Create the file header. | |
bool | formatHeader (const std::string &name, int filesize) |
Create the file header. | |
bool | writeFile () |
Write the data to disk as a .sol file. | |
bool | writeFile (const std::string &filespec, const std::string &objname) |
Write the data to disk as a .sol file. | |
bool | readFile (const std::string &filespec) |
Read a .sol file from disk. | |
std::vector< boost::uint8_t > | getHeader () |
Get the stored copy of the header. | |
void | addObj (boost::shared_ptr< Element > el) |
Add the AMF objects that are the data of the file. | |
std::vector< boost::shared_ptr < cygnal::Element > > & | getElements () |
Return a reference to the elements in this object. | |
boost::shared_ptr< Element > | getElement (size_t size) |
Get an element referenced by index in the array. | |
void | setFilespec (const std::string &filespec) |
Set the filespec for the .sol file. Set's the full path and file name to the .sol file to be read or written. | |
const std::string & | getFilespec () const |
Get the filespec of the .sol file. | |
void | setObjectName (const std::string &objname) |
Set the name of the SharedObject. | |
const std::string & | getObjectName () const |
Get the filespec of the .sol file. | |
bool | updateSO (boost::shared_ptr< cygnal::Element > &el) |
bool | updateSO (int index, boost::shared_ptr< cygnal::Element > &el) |
void | dump () |
Dump the internal data of this class in a human readable form. | |
SOL () | |
~SOL () | |
size_t | size () const |
Get the number of Elements in this class. | |
size_t | fileSize () const |
bool | extractHeader (const std::vector< boost::uint8_t > &data) |
Extract the header from the file. | |
bool | extractHeader (const std::string &filespec) |
Extract the header from the file. | |
bool | formatHeader (const std::vector< boost::uint8_t > &data) |
Create the file header. | |
bool | formatHeader (const std::string &name) |
Create the file header. | |
bool | formatHeader (const std::string &name, int filesize) |
Create the file header. | |
bool | writeFile () |
Write the data to disk as a .sol file. | |
bool | writeFile (const std::string &filespec, const std::string &objname) |
Write the data to disk as a .sol file. | |
bool | readFile (const std::string &filespec) |
Read a .sol file from disk. | |
std::vector< boost::uint8_t > | getHeader () |
Get the stored copy of the header. | |
void | addObj (boost::shared_ptr< Element > el) |
Add the AMF objects that are the data of the file. | |
std::vector< boost::shared_ptr < cygnal::Element > > & | getElements () |
Return a reference to the elements in this object. | |
boost::shared_ptr< Element > | getElement (size_t size) |
Get an element referenced by index in the array. | |
void | setFilespec (const std::string &filespec) |
Set the filespec for the .sol file. Set's the full path and file name to the .sol file to be read or written. | |
const std::string & | getFilespec () const |
Get the filespec of the .sol file. | |
void | setObjectName (const std::string &objname) |
Set the name of the SharedObject. | |
const std::string & | getObjectName () const |
Get the filespec of the .sol file. | |
bool | updateSO (boost::shared_ptr< cygnal::Element > &el) |
bool | updateSO (int index, boost::shared_ptr< cygnal::Element > &el) |
void | dump () |
Dump the internal data of this class in a human readable form. | |
Protected Attributes | |
std::vector< boost::shared_ptr < Element > > | _amfobjs |
This class is for accessing the data in SharedObject files, also called "Flash cookies". These .sol files are just a collection of AMF0 data, with a simple file header.
cygnal::SOL::SOL | ( | ) |
cygnal::SOL::~SOL | ( | ) |
cygnal::SOL::SOL | ( | ) |
cygnal::SOL::~SOL | ( | ) |
void cygnal::SOL::addObj | ( | boost::shared_ptr< Element > | el | ) |
void cygnal::SOL::addObj | ( | boost::shared_ptr< Element > | el | ) |
void cygnal::SOL::dump | ( | ) |
Dump the internal data of this class in a human readable form.
References _amfobjs, and cygnal::swapBytes().
Referenced by main().
void cygnal::SOL::dump | ( | ) |
Dump the internal data of this class in a human readable form.
bool cygnal::SOL::extractHeader | ( | const std::string & | filespec | ) |
Extract the header from the file.
filespec | The name and path of the .sol file to parse. |
bool cygnal::SOL::extractHeader | ( | const std::vector< boost::uint8_t > & | data | ) |
Extract the header from the file.
data | a reference to a vector of bytes that contains the .sol file data. |
bool cygnal::SOL::extractHeader | ( | const std::vector< boost::uint8_t > & | data | ) |
Extract the header from the file.
data | a reference to a vector of bytes that contains the .sol file data. |
bool cygnal::SOL::extractHeader | ( | const std::string & | filespec | ) |
Extract the header from the file.
filespec | The name and path of the .sol file to parse. |
size_t cygnal::SOL::fileSize | ( | ) | const [inline] |
size_t cygnal::SOL::fileSize | ( | ) | const [inline] |
bool cygnal::SOL::formatHeader | ( | const std::vector< boost::uint8_t > & | data | ) |
Create the file header.
data | a reference to a vector of bytes that contains the .sol file data. |
Referenced by formatHeader(), and writeFile().
bool cygnal::SOL::formatHeader | ( | const std::string & | name | ) |
Create the file header.
name | The name of the SharedObject for this file. |
References formatHeader().
bool cygnal::SOL::formatHeader | ( | const std::vector< boost::uint8_t > & | data | ) |
Create the file header.
data | a reference to a vector of bytes that contains the .sol file data. |
bool cygnal::SOL::formatHeader | ( | const std::string & | name | ) |
Create the file header.
name | The name of the SharedObject for this file. |
bool cygnal::SOL::formatHeader | ( | const std::string & | name, | |
int | filesize | |||
) |
Create the file header.
name | The name of the SharedObject for this file. | |
filesize | The size of the file. |
References _, __FUNCTION__, gnash::hexify(), SOL_BLOCK_MARK, and SOL_MAGIC.
bool cygnal::SOL::formatHeader | ( | const std::string & | name, | |
int | filesize | |||
) |
Create the file header.
name | The name of the SharedObject for this file. | |
filesize | The size of the file. |
boost::shared_ptr<Element> cygnal::SOL::getElement | ( | size_t | size | ) | [inline] |
Get an element referenced by index in the array.
size | The index of the property to retrieve. |
boost::shared_ptr<Element> cygnal::SOL::getElement | ( | size_t | size | ) | [inline] |
Get an element referenced by index in the array.
size | The index of the property to retrieve. |
std::vector<boost::shared_ptr<cygnal::Element> >& cygnal::SOL::getElements | ( | ) | [inline] |
Return a reference to the elements in this object.
std::vector<boost::shared_ptr<cygnal::Element> >& cygnal::SOL::getElements | ( | ) | [inline] |
Return a reference to the elements in this object.
const std::string& cygnal::SOL::getFilespec | ( | ) | const [inline] |
Get the filespec of the .sol file.
const std::string& cygnal::SOL::getFilespec | ( | ) | const [inline] |
Get the filespec of the .sol file.
std::vector<boost::uint8_t> cygnal::SOL::getHeader | ( | ) | [inline] |
Get the stored copy of the header.
std::vector<boost::uint8_t> cygnal::SOL::getHeader | ( | ) | [inline] |
Get the stored copy of the header.
const std::string& cygnal::SOL::getObjectName | ( | ) | const [inline] |
Get the filespec of the .sol file.
const std::string& cygnal::SOL::getObjectName | ( | ) | const [inline] |
Get the filespec of the .sol file.
bool cygnal::SOL::readFile | ( | const std::string & | filespec | ) |
Read a .sol file from disk.
filespec | The name and path of the .sol file to parse. |
References _amfobjs, gnash::key::e, ENSUREBYTES, cygnal::AMF::extractProperty(), length, and cygnal::AMF::totalsize().
Referenced by main().
bool cygnal::SOL::readFile | ( | const std::string & | filespec | ) |
Read a .sol file from disk.
filespec | The name and path of the .sol file to parse. |
void cygnal::SOL::setFilespec | ( | const std::string & | filespec | ) | [inline] |
Set the filespec for the .sol file. Set's the full path and file name to the .sol file to be read or written.
filespec | The name and path of the .sol file to parse. |
void cygnal::SOL::setFilespec | ( | const std::string & | filespec | ) | [inline] |
Set the filespec for the .sol file. Set's the full path and file name to the .sol file to be read or written.
filespec | The name and path of the .sol file to parse. |
void cygnal::SOL::setObjectName | ( | const std::string & | objname | ) | [inline] |
Set the name of the SharedObject.
objname | The name of the SharedObject in the .sol file. |
void cygnal::SOL::setObjectName | ( | const std::string & | objname | ) | [inline] |
Set the name of the SharedObject.
objname | The name of the SharedObject in the .sol file. |
size_t cygnal::SOL::size | ( | ) | const [inline] |
size_t cygnal::SOL::size | ( | ) | const [inline] |
Get the number of Elements in this class.
bool cygnal::SOL::updateSO | ( | boost::shared_ptr< cygnal::Element > & | el | ) |
bool cygnal::SOL::updateSO | ( | int | index, | |
boost::shared_ptr< cygnal::Element > & | el | |||
) |
bool cygnal::SOL::updateSO | ( | boost::shared_ptr< cygnal::Element > & | el | ) |
References _amfobjs.
bool cygnal::SOL::updateSO | ( | int | index, | |
boost::shared_ptr< cygnal::Element > & | el | |||
) |
References _amfobjs.
bool cygnal::SOL::writeFile | ( | const std::string & | filespec, | |
const std::string & | objname | |||
) |
Write the data to disk as a .sol file.
filespec | The name and path of the .sol file to parse. | |
objname | The name of the SharedObject for this file. |
bool cygnal::SOL::writeFile | ( | ) |
Write the data to disk as a .sol file.
bool cygnal::SOL::writeFile | ( | const std::string & | filespec, | |
const std::string & | name | |||
) |
Write the data to disk as a .sol file.
filespec | The name and path of the .sol file to parse. | |
objname | The name of the SharedObject for this file. |
filespec | The name and path of the .sol file to parse. | |
name | The name of the SharedObject for this file. |
References _amfobjs, cygnal::AMF0_NUMBER_SIZE, cygnal::Element::BOOLEAN_AMF0, cygnal::AMF::encodeProperty(), fail(), formatHeader(), cygnal::Element::NUMBER_AMF0, cygnal::Element::OBJECT_AMF0, size(), and cygnal::Element::STRING_AMF0.
bool cygnal::SOL::writeFile | ( | ) |
Write the data to disk as a .sol file.
std::vector< boost::shared_ptr< Element > > cygnal::SOL::_amfobjs [protected] |
The array of elements in this SharedObject.
Referenced by dump(), readFile(), updateSO(), and writeFile().