Beispiel #1
0
void  ImportGPSDataGPGGAFiles ()
{
  KKStrListPtr   files = osGetListOfFiles ("952X-GPGGA*.Raw");
  if  ((files == NULL)  ||  (files->QueueSize () < 1))
  {
    cerr << endl << endl
      << "ImportGPSDataGPGGAFiles    ***ERROR***     No Files Found" << endl
      << endl;
    delete  files;
    files = NULL;
    return;
  }

  KKStrList::iterator  idx;
  
  for  (idx = files->begin ();  idx != files->end ();  idx++)
  {
    ImportGPSDataGPGGA (**idx);
  }

  delete  files;
}  /* ImportGPSDataGPGGAFiles */
Beispiel #2
0
XmlTag::XmlTag (TokenizerPtr  tokenStream):
     tagType (tagNULL)
{
  // We are assumed to be at the beginning of a new tag.
  KKStrListPtr  tokens = tokenStream->GetNextTokens (">");
  if  (!tokens)
    return;

  KKStrPtr t = NULL;

  if  (tokens->QueueSize () < 1)
  {
    delete  tokens;
    return;
  }

  if  ((*tokens)[0] == "<")
  {
    t = tokens->PopFromFront ();
    delete  t;
    t = NULL;
  }

  // We will assume that we have a start tag unless proven otherwise.
  tagType = tagStart;

  if  ((tokens->QueueSize () > 0)  &&  (*(tokens->BackOfQueue ()) == ">"))
  {
    t = tokens->PopFromBack ();
    delete t;
    t = NULL;

    if  ((tokens->QueueSize () > 0)  &&  (*(tokens->BackOfQueue ()) == "/"))
    {
      // We have a Empty tag.
      tagType = tagEmpty;
    }
  }

  if  ((tokens->QueueSize () > 0)  &&  ((*tokens)[0] == "/"))
  {
    // We have a Ending Tag
    tagType = tagEnd;
    t = tokens->PopFromBack ();
    delete t;
    t = NULL;

    if  (tokens->QueueSize () > 0)
      name = (*tokens)[0];

    delete  tokens;
    tokens = NULL;
    return;
  }


  if  (tokens->QueueSize () < 1)
  {
    delete  tokens;
    return;
  }


  // At this point the only thing in tokens should be Attribute Pairs.
  int32  idx = 0;
  name = (*tokens)[idx];
  idx++;

  KKStr  attrName = "";
  KKStr  attrValue = "";

  while  (idx < tokens->QueueSize ())
  {
    attrName = "";
    attrValue = "";

    attrName = (*tokens)[idx];  idx++;

    if  (idx < tokens->QueueSize ())
    {
      if  ((*tokens)[idx] == "=")
      {
        idx++;
        if  (idx < tokens->QueueSize ())
        {
          attrValue = (*tokens)[idx];
          idx++;
        }
      }

      attributes.push_back (XmlAttribute (attrName, attrValue));
    }

    if  ((idx < tokens->QueueSize ())  &&  ((*tokens)[idx] == ","))
      idx++;
  }

  delete  tokens;  tokens = NULL;
}  /* XmlTag::XmlTag (TokenizerPtr  tokenStream) */