NCBI C++ ToolKit
Classes | Macros | Functions | Variables
xmlmisc.cpp File Reference
#include <ncbi_pch.hpp>
#include "ftacpp.hpp"
#include "ftaerr.hpp"
#include "xmlmisc.h"
+ Include dependency graph for xmlmisc.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  XmlTable
 

Macros

#define THIS_FILE   "xmlmisc.cpp"
 
#define XML_START_TAG   1
 
#define XML_END_TAG   2
 
#define XML_ATTRIBUTE   3
 
#define XML_CONTENT   4
 

Functions

static char * DecodeXml (char *str)
 
static char * TrimSpacesAroundString (char *str)
 
static void TokenizeXmlLine (ValNodePtr *headp, ValNodePtr *tailp, char *str)
 
static ValNodePtr TokenizeXmlString (char *str)
 
static XmlObjPtr ProcessAttribute (char *str)
 
static XmlObjPtr ProcessStartTag (ValNodePtr *curr, XmlObjPtr parent, const Char *name)
 
static XmlObjPtr SetSuccessors (XmlObjPtr xop, XmlObjPtr prev, short level)
 
static XmlObjPtr ParseXmlTokens (ValNodePtr head)
 
XmlObjPtr FreeXmlObject (XmlObjPtr xop)
 
XmlObjPtr ParseXmlString (const Char *str)
 
static int VisitXmlNodeProc (XmlObjPtr xop, XmlObjPtr parent, short level, void *userdata, VisitXmlNodeFunc callback, char *nodeFilter, char *parentFilter, char *attrTagFilter, char *attrValFilter, short maxDepth)
 
int VisitXmlNodes (XmlObjPtr xop, void *userdata, VisitXmlNodeFunc callback, char *nodeFilter, char *parentFilter, char *attrTagFilter, char *attrValFilter, short maxDepth)
 

Variables

static const XmlTable xmlcodes []
 

Macro Definition Documentation

◆ THIS_FILE

#define THIS_FILE   "xmlmisc.cpp"

Definition at line 43 of file xmlmisc.cpp.

◆ XML_ATTRIBUTE

#define XML_ATTRIBUTE   3

Definition at line 47 of file xmlmisc.cpp.

◆ XML_CONTENT

#define XML_CONTENT   4

Definition at line 48 of file xmlmisc.cpp.

◆ XML_END_TAG

#define XML_END_TAG   2

Definition at line 46 of file xmlmisc.cpp.

◆ XML_START_TAG

#define XML_START_TAG   1

Definition at line 45 of file xmlmisc.cpp.

Function Documentation

◆ DecodeXml()

static char* DecodeXml ( char *  str)
static

◆ FreeXmlObject()

XmlObjPtr FreeXmlObject ( XmlObjPtr  xop)

◆ ParseXmlString()

XmlObjPtr ParseXmlString ( const Char str)

◆ ParseXmlTokens()

static XmlObjPtr ParseXmlTokens ( ValNodePtr  head)
static

Definition at line 468 of file xmlmisc.cpp.

References head, ProcessStartTag(), and SetSuccessors().

Referenced by ParseXmlString().

◆ ProcessAttribute()

static XmlObjPtr ProcessAttribute ( char *  str)
static

◆ ProcessStartTag()

static XmlObjPtr ProcessStartTag ( ValNodePtr curr,
XmlObjPtr  parent,
const Char name 
)
static

◆ SetSuccessors()

static XmlObjPtr SetSuccessors ( XmlObjPtr  xop,
XmlObjPtr  prev,
short  level 
)
static

Definition at line 448 of file xmlmisc.cpp.

References XmlObj::children, XmlObj::level, prev(), and tmp.

Referenced by ParseXmlTokens().

◆ TokenizeXmlLine()

static void TokenizeXmlLine ( ValNodePtr headp,
ValNodePtr tailp,
char *  str 
)
static

◆ TokenizeXmlString()

static ValNodePtr TokenizeXmlString ( char *  str)
static

Definition at line 303 of file xmlmisc.cpp.

References head, str(), StringHasNoText(), and TokenizeXmlLine().

Referenced by ParseXmlString().

◆ TrimSpacesAroundString()

static char* TrimSpacesAroundString ( char *  str)
static

Definition at line 113 of file xmlmisc.cpp.

References str().

Referenced by ProcessAttribute(), ProcessStartTag(), and TokenizeXmlLine().

◆ VisitXmlNodeProc()

static int VisitXmlNodeProc ( XmlObjPtr  xop,
XmlObjPtr  parent,
short  level,
void *  userdata,
VisitXmlNodeFunc  callback,
char *  nodeFilter,
char *  parentFilter,
char *  attrTagFilter,
char *  attrValFilter,
short  maxDepth 
)
static

◆ VisitXmlNodes()

int VisitXmlNodes ( XmlObjPtr  xop,
void *  userdata,
VisitXmlNodeFunc  callback,
char *  nodeFilter,
char *  parentFilter,
char *  attrTagFilter,
char *  attrValFilter,
short  maxDepth 
)

Definition at line 625 of file xmlmisc.cpp.

References max(), and VisitXmlNodeProc().

Variable Documentation

◆ xmlcodes

const XmlTable xmlcodes[]
static
Initial value:
= {
{ "&amp;", 5, '&' },
{ "&apos;", 6, '\'' },
{ "&gt;", 4, '>' },
{ "&lt;", 4, '<' },
{ "&quot;", 6, '"' },
{ nullptr, 0, '\0' }
}

Definition at line 60 of file xmlmisc.cpp.

Referenced by DecodeXml().

Modified on Thu May 09 18:35:47 2024 by modify_doxy.py rev. 669887