[DEV] change idea std::u32string to std::string
This commit is contained in:
parent
32b1966f8d
commit
03efb06322
@ -38,8 +38,7 @@ void esvg::Base::parseTransform(exml::Element* _element) {
|
|||||||
double matrix[6];
|
double matrix[6];
|
||||||
float angle, xxx, yyy;
|
float angle, xxx, yyy;
|
||||||
int32_t n;
|
int32_t n;
|
||||||
etk::Char myData = inputString.c_str();
|
const char * pointerOnData = inputString.c_str();
|
||||||
const char * pointerOnData = myData;
|
|
||||||
while (*pointerOnData) {
|
while (*pointerOnData) {
|
||||||
if (sscanf(pointerOnData, "matrix (%lf %lf %lf %lf %lf %lf) %n", &matrix[0], &matrix[1], &matrix[2], &matrix[3], &matrix[4], &matrix[5], &n) == 6) {
|
if (sscanf(pointerOnData, "matrix (%lf %lf %lf %lf %lf %lf) %n", &matrix[0], &matrix[1], &matrix[2], &matrix[3], &matrix[4], &matrix[5], &n) == 6) {
|
||||||
m_transformMatrix.load_from(matrix);
|
m_transformMatrix.load_from(matrix);
|
||||||
@ -119,7 +118,7 @@ void esvg::Base::parsePosition(const exml::Element *_element, etk::Vector2D<floa
|
|||||||
*/
|
*/
|
||||||
float esvg::Base::parseLength(const std::string& _dataInput) {
|
float esvg::Base::parseLength(const std::string& _dataInput) {
|
||||||
SVG_VERBOSE(" lenght : '" << _dataInput << "'");
|
SVG_VERBOSE(" lenght : '" << _dataInput << "'");
|
||||||
float n = _dataInput.toFloat();
|
float n = stof(_dataInput);
|
||||||
std::string unit;
|
std::string unit;
|
||||||
for (int32_t iii=0; iii<_dataInput.size(); iii++) {
|
for (int32_t iii=0; iii<_dataInput.size(); iii++) {
|
||||||
if( (_dataInput[iii]>='0' && _dataInput[iii]<='9')
|
if( (_dataInput[iii]>='0' && _dataInput[iii]<='9')
|
||||||
@ -128,7 +127,7 @@ float esvg::Base::parseLength(const std::string& _dataInput) {
|
|||||||
|| _dataInput[iii]<='.') {
|
|| _dataInput[iii]<='.') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
unit = _dataInput.extract(iii-1);
|
unit = std::string(_dataInput, iii-1);
|
||||||
}
|
}
|
||||||
//SVG_INFO(" == > ?? = " << n );
|
//SVG_INFO(" == > ?? = " << n );
|
||||||
float font_size = 20.0f;
|
float font_size = 20.0f;
|
||||||
|
@ -34,7 +34,10 @@ const char * extractCmd(const char* _input, char& _cmd, std::vector<float>& _out
|
|||||||
_outputList.clear();
|
_outputList.clear();
|
||||||
_cmd = '\0';
|
_cmd = '\0';
|
||||||
const char * outputPointer = NULL;
|
const char * outputPointer = NULL;
|
||||||
if (!( (_input[0] <= 'Z' && _input[0] >= 'A') || (_input[0] <= 'z' && _input[0] >= 'a') ) ) {
|
if (!( ( _input[0] <= 'Z'
|
||||||
|
&& _input[0] >= 'A')
|
||||||
|
|| ( _input[0] <= 'z'
|
||||||
|
&& _input[0] >= 'a') ) ) {
|
||||||
SVG_ERROR("Error in the SVG Path : \"" << _input << "\"");
|
SVG_ERROR("Error in the SVG Path : \"" << _input << "\"");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -83,8 +86,7 @@ bool esvg::Path::parse(exml::Element * _element, agg::trans_affine& _parentTrans
|
|||||||
char command;
|
char command;
|
||||||
std::vector<float> listDot;
|
std::vector<float> listDot;
|
||||||
|
|
||||||
etk::Char plop = elementXML1.c_str();
|
const char* elementXML = elementXML1.c_str();
|
||||||
const char* elementXML = plop;
|
|
||||||
|
|
||||||
for( const char *sss=extractCmd(elementXML, command, listDot);
|
for( const char *sss=extractCmd(elementXML, command, listDot);
|
||||||
NULL != sss;
|
NULL != sss;
|
||||||
|
@ -41,8 +41,7 @@ bool esvg::Polygon::parse(exml::Element * _element, agg::trans_affine& _parentTr
|
|||||||
SVG_ERROR("(l "/*<<_element->Pos()*/<<") polygon: missing points attribute");
|
SVG_ERROR("(l "/*<<_element->Pos()*/<<") polygon: missing points attribute");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
etk::Char sss2 = sss1.c_str();
|
const char * sss = sss1.c_str();
|
||||||
const char * sss = sss2;
|
|
||||||
_sizeMax.setValue(0,0);
|
_sizeMax.setValue(0,0);
|
||||||
SVG_VERBOSE("Parse polygon : \"" << sss << "\"");
|
SVG_VERBOSE("Parse polygon : \"" << sss << "\"");
|
||||||
while ('\0' != sss[0]) {
|
while ('\0' != sss[0]) {
|
||||||
|
@ -38,8 +38,7 @@ bool esvg::Polyline::parse(exml::Element * _element, agg::trans_affine& _parentT
|
|||||||
}
|
}
|
||||||
_sizeMax.setValue(0,0);
|
_sizeMax.setValue(0,0);
|
||||||
SVG_VERBOSE("Parse polyline : \"" << sss1 << "\"");
|
SVG_VERBOSE("Parse polyline : \"" << sss1 << "\"");
|
||||||
etk::Char sss2 = sss1.c_str();
|
const char* sss = sss1.c_str();
|
||||||
const char* sss = sss2;
|
|
||||||
while ('\0' != sss[0]) {
|
while ('\0' != sss[0]) {
|
||||||
etk::Vector2D<float> pos;
|
etk::Vector2D<float> pos;
|
||||||
int32_t n;
|
int32_t n;
|
||||||
|
@ -35,7 +35,8 @@
|
|||||||
#define __class__ "Document"
|
#define __class__ "Document"
|
||||||
|
|
||||||
|
|
||||||
esvg::Document::Document(const std::string& _fileName) : m_renderedElement(NULL) {
|
esvg::Document::Document(const std::string& _fileName) :
|
||||||
|
m_renderedElement(NULL) {
|
||||||
m_fileName = _fileName;
|
m_fileName = _fileName;
|
||||||
m_version = "0.0";
|
m_version = "0.0";
|
||||||
m_loadOK = true;
|
m_loadOK = true;
|
||||||
@ -62,7 +63,7 @@ esvg::Document::Document(const std::string& _fileName) : m_renderedElement(NULL)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
exml::Element* root = (exml::Element*)doc.getNamed( "svg" );
|
exml::Element* root = (exml::Element*)doc.getNamed("svg" );
|
||||||
if (NULL == root ) {
|
if (NULL == root ) {
|
||||||
SVG_ERROR("(l ?) main node not find: \"svg\" in \"" << m_fileName << "\"");
|
SVG_ERROR("(l ?) main node not find: \"svg\" in \"" << m_fileName << "\"");
|
||||||
m_loadOK = false;
|
m_loadOK = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user