All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::qt::af::XMLFormatter Class Reference

A class that formats strings. More...

#include <XMLFormatter.h>

Static Public Member Functions

static void format (Project *p, const bool &encode)
 Formats the project informations. More...
 
static void format (te::map::AbstractLayer *l, const bool &encode)
 Formats the layer informations. More...
 
static void format (te::da::DataSourceInfo *d, const bool &encode)
 Formats the data source informations. More...
 
static std::string format (const std::string &s, const bool &encode)
 Formats the string. More...
 
static void formatDataSourceInfos (const bool &encode)
 Formats all data source informations registered in the te::da::DataSourceInfoManager object. More...
 

Detailed Description

A class that formats strings.

Use this class for changing strings, contained in some TerraLib objects, to XML percentage encode format and/or to human readable format. Use XML formatting before serializing the object to a XML file, for example, and human readable format after read the object from a XML.

Definition at line 55 of file XMLFormatter.h.

Member Function Documentation

void te::qt::af::XMLFormatter::format ( Project p,
const bool &  encode 
)
static

Formats the project informations.

Parameters
pThe project.
encodePass true to change for XML percentage format and false for human readable format.

Definition at line 35 of file XMLFormatter.cpp.

References te::common::uri::urisyn::encode(), te::qt::af::Project::getAuthor(), te::qt::af::Project::getTitle(), te::qt::af::Project::getTopLayers(), te::qt::af::Project::setAuthor(), and te::qt::af::Project::setTitle().

Referenced by format(), and formatDataSourceInfos().

void te::qt::af::XMLFormatter::format ( te::map::AbstractLayer l,
const bool &  encode 
)
static

Formats the layer informations.

Parameters
lThe layer.
encodePass true to change for XML percentage format and false for human readable format.
Note
The sublayers will be formatted too, using the encode passed.

Definition at line 47 of file XMLFormatter.cpp.

References te::common::uri::urisyn::encode(), format(), te::common::TreeItem::getChildren(), te::map::DataSetLayer::getDataSetName(), te::map::AbstractLayer::getTitle(), te::map::AbstractLayer::getType(), te::map::DataSetLayer::setDataSetName(), and te::map::AbstractLayer::setTitle().

void te::qt::af::XMLFormatter::format ( te::da::DataSourceInfo d,
const bool &  encode 
)
static

Formats the data source informations.

Parameters
dThe data source info.
encodePass true to change for XML percentage format and false for human readable format.

Definition at line 68 of file XMLFormatter.cpp.

References te::common::uri::urisyn::encode(), format(), te::da::DataSourceInfo::getConnInfo(), te::da::DataSourceInfo::getDescription(), te::da::DataSourceInfo::getTitle(), te::da::DataSourceInfo::setDescription(), and te::da::DataSourceInfo::setTitle().

std::string te::qt::af::XMLFormatter::format ( const std::string &  s,
const bool &  encode 
)
static

Formats the string.

Parameters
sThe string.
encodePass true to change for XML percentage format and false for human readable format.

Definition at line 95 of file XMLFormatter.cpp.

void te::qt::af::XMLFormatter::formatDataSourceInfos ( const bool &  encode)
static

Formats all data source informations registered in the te::da::DataSourceInfoManager object.

Parameters
encodePass true to change for XML percentage format and false for human readable format.
See also
te::da::DataSourceInfoManager

Definition at line 85 of file XMLFormatter.cpp.

References te::common::uri::urisyn::encode(), format(), and te::common::Singleton< DataSourceInfoManager >::getInstance().

Referenced by te::qt::af::ApplicationController::initialize().


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