KSquare Utilities
KKB::VectorKKStr Class Reference

#include <KKStr.h>

+ Inheritance diagram for KKB::VectorKKStr:

Public Member Functions

 VectorKKStr ()
 
 VectorKKStr (const VectorKKStr &v)
 
void ReadXML (XmlStream &s, XmlTagConstPtr tag, VolConstBool &cancelFlag, RunLog &log)
 
void WriteXML (const KKStr &varName, std::ostream &o) const
 

Detailed Description

summary> A string class providing safe runtime management; strings can be used as stream and StringBuilder objects. Simple token parsing is supported as well as various translations to other formats such as 'int', 'double', and others. Allocation is done dynamically increasing as needs warrant. All methods ensure that there is no accessing outside the bounds of the allocated string. /summary> todo> Should subclass the class from the stl class 'string'. </todo>

Definition at line 54 of file KKStr.h.

Constructor & Destructor Documentation

VectorKKStr::VectorKKStr ( const VectorKKStr v)

Definition at line 5270 of file KKStr.cpp.

References VectorKKStr().

Referenced by KKB::Configuration::Configuration(), KKMLL::TrainingClass::TrainingClass(), and VectorKKStr().

5270  :
5271  vector<KKStr> (v)
5272 {
5273 }

Member Function Documentation

void VectorKKStr::ReadXML ( XmlStream s,
XmlTagConstPtr  tag,
VolConstBool cancelFlag,
RunLog log 
)

Definition at line 5277 of file KKStr.cpp.

References KKB::XmlTag::AttributeValueInt32(), KKB::KKStr::Concat(), KKB::XmlContent::Content(), KKB::KKStrParser::GetNextToken(), KKB::XmlStream::GetNextToken(), KKB::KKStrParser::KKStrParser(), KKB::KKStrParser::MoreTokens(), KKB::XmlToken::tokContent, KKB::XmlToken::TokenType(), and KKB::KKStrParser::TrimWhiteSpace().

5282 {
5283  kkuint32 count = (kkuint32)tag->AttributeValueInt32 ("Count");
5284 
5285  clear ();
5286 
5287  XmlTokenPtr t = s.GetNextToken (cancelFlag, log);
5288 
5289  while (t && (!cancelFlag))
5290  {
5292  {
5293  XmlContentPtr c = dynamic_cast<XmlContentPtr>(t);
5294  if ((c != NULL) && (c->Content () != NULL))
5295  {
5296  KKStrParser parser (*(c->Content ()));
5297  parser.TrimWhiteSpace (" ");
5298  while (parser.MoreTokens ())
5299  {
5300  KKStr field = parser.GetNextToken ("\t");
5301  push_back (field);
5302  }
5303  }
5304  }
5305 
5306  delete t;
5307  if (cancelFlag)
5308  t = NULL;
5309  else
5310  t = s.GetNextToken (cancelFlag, log);
5311  }
5312  delete t;
5313  t = NULL;
5314 } /* ReadXML */
unsigned __int32 kkuint32
Definition: KKBaseTypes.h:89
KKStrPtr const Content() const
Definition: XmlStream.h:338
virtual TokenTypes TokenType()=0
Class that manages the extraction of tokens from a String without being destructive to the original s...
Definition: KKStrParser.h:18
virtual XmlTokenPtr GetNextToken(VolConstBool &cancelFlag, RunLog &log)
Definition: XmlStream.cpp:116
void VectorKKStr::WriteXML ( const KKStr varName,
std::ostream &  o 
) const

Definition at line 5319 of file KKStr.cpp.

References KKB::XmlTag::AddAtribute(), KKB::KKStr::Empty(), KKB::operator<<(), KKB::XmlTag::tagEnd, KKB::XmlTag::tagStart, KKB::XmlTag::WriteXML(), and KKB::XmlTag::XmlTag().

Referenced by KKMLL::Attribute::WriteXML().

5322 {
5323  XmlTag startTag ("VectorKKStr", XmlTag::TagTypes::tagStart);
5324  if (!varName.Empty ())
5325  startTag.AddAtribute ("VarName", varName);
5326  startTag.AddAtribute ("Count", (kkint32)size ());
5327  startTag.WriteXML (o);
5328 
5329  const_iterator idx;
5330  kkuint32 x = 0;
5331  for (idx = begin (); idx != end (); ++idx, ++x)
5332  {
5333  if (x > 0) o << "\t";
5334  XmlContent::WriteXml (idx->QuotedStr (), o);
5335  }
5336  XmlTag endTag ("VectorKKStr", XmlTag::TagTypes::tagEnd);
5337  endTag.WriteXML (o);
5338  o << endl;
5339 }
HTMLReport &__cdecl endl(HTMLReport &htmlReport)
Definition: HTMLReport.cpp:240
__int32 kkint32
Definition: KKBaseTypes.h:88
unsigned __int32 kkuint32
Definition: KKBaseTypes.h:89
bool Empty() const
Definition: KKStr.h:241
static void WriteXml(const KKStr &s, std::ostream &o)
Definition: XmlStream.cpp:853

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