@@ -240,10 +240,15 @@ std::string WSJCppYAMLItem::toString() {
240240 if (this ->isValue ()) {
241241 sRet = m_sValue;
242242 if (m_sComment.length () > 0 ) {
243- sRet += " #" + m_sComment;
243+ if (sRet .length () > 0 ) {
244+ sRet += " " ;
245+ }
246+ sRet += " #" + m_sComment;
244247 }
245248 } else if (this ->isEmpty ()) {
246- sRet = " #" + m_sComment;
249+ if (m_sComment.length () > 0 ) {
250+ sRet += " #" + m_sComment;
251+ }
247252 } else if (this ->isArray ()) {
248253 sRet += " \n " ;
249254 for (int i = 0 ; i < m_vObjects.size (); i++) {
@@ -511,7 +516,7 @@ bool WSJCppYAML::loadFromString(std::string &sBuffer) {
511516
512517// ---------------------------------------------------------------------
513518
514- bool WSJCppYAML::saveToString (std::string &sBuffer ) {
519+ bool WSJCppYAML::saveToString (std::string &sBuffer ) { // TODO move to fallen
515520 sBuffer = m_pRoot->toString ();
516521 return true ;
517522}
@@ -553,7 +558,7 @@ bool WSJCppYAML::parse(const std::string &sBuffer) {
553558
554559 for (int nLine = 0 ; nLine < vLines.size (); nLine++) {
555560 st.sLine = vLines[nLine];
556- Log::info (TAG, " Line(" + std::to_string (nLine) + " ) '" + st.sLine + " '" );
561+ // Log::info(TAG, "Line(" + std::to_string(nLine) + ") '" + st.sLine + "'");
557562 st.nLine = nLine;
558563 st.line = WSJCppYAMLParsebleLine (nLine);
559564 st.line .parseLine (st.sLine );
0 commit comments