本文整理汇总了C++中XalanDOMString::c_str方法的典型用法代码示例。如果您正苦于以下问题:C++ XalanDOMString::c_str方法的具体用法?C++ XalanDOMString::c_str怎么用?C++ XalanDOMString::c_str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XalanDOMString
的用法示例。
在下文中一共展示了XalanDOMString::c_str方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/**
* Determine the fully qualified URI for a string.
*
* @param urlString string to qualify
* @param base base location for URI
* @param theNormalizedURI fully qualified URI
*/
static void
getURLStringFromString(
const XalanDOMString& urlString,
const XalanDOMString& base,
XalanDOMString& theNormalizedURI)
{
getURLStringFromString(urlString.c_str(), base.c_str(), theNormalizedURI);
}
示例2: InputSource
XSLTInputSource::XSLTInputSource(
const XalanDOMString& systemId,
const XalanDOMString& publicId,
MemoryManager& theMemoryManager) :
InputSource(
systemId.c_str(),
publicId.c_str(),
&theMemoryManager),
m_stream(0),
m_node(0)
{
}
示例3: equals
bool
XalanDOMString::equals(
const XalanDOMString& theLHS,
const XalanDOMString& theRHS)
{
const XalanDOMString::size_type theLHSLength = theLHS.size();
const XalanDOMString::size_type theRHSLength = theRHS.size();
if (theLHSLength != theRHSLength)
{
return false;
}
else
{
return equals(theLHS.c_str(), theLHSLength, theRHS.c_str(), theRHSLength);
}
}
示例4: doTranscodeToLocalCodePage
TranscodeToLocalCodePage(
const XalanDOMString& theSourceString,
CharVectorType& theTargetVector,
bool terminate,
char theSubstitutionChar)
{
doTranscodeToLocalCodePage(
theSourceString.c_str(),
theSourceString.length(),
true,
theTargetVector,
terminate,
theSubstitutionChar);
}
示例5: string
/**
* Calls the supplied FormatterListener member function with
* the string.
*
* @param theString The XalanDOMString to convert.
* @param formatterListener The FormatterListener instance.
* @param function The FormatterListener member function to call.
*/
static void
string(
const XalanDOMString& theString,
FormatterListener& formatterListener,
MemberFunctionPtr function)
{
const XalanDOMString::size_type theLength =
theString.length();
if (theLength != 0)
{
assert(theLength == static_cast<FormatterListener::size_type>(theLength));
(formatterListener.*function)(
theString.c_str(),
static_cast<FormatterListener::size_type>(theLength));
}
}
示例6: write
void
write(const XalanDOMString& theChars)
{
write(theChars.c_str(), theChars.length());
}
示例7: evaluateExpr
void TXFMXPath::evaluateExpr(DOMNode *h, safeBuffer inexpr) {
// Temporarily add any necessary name spaces into the document
XSECXPathNodeList addedNodes;
setXPathNS(document, XPathAtts, addedNodes, formatter, mp_nse);
XPathProcessorImpl xppi; // The processor
XercesParserLiaison xpl;
#if XALAN_VERSION_MAJOR == 1 && XALAN_VERSION_MINOR > 10
XercesDOMSupport xds(xpl);
#else
XercesDOMSupport xds;
#endif
XPathEvaluator xpe;
XPathFactoryDefault xpf;
XPathConstructionContextDefault xpcc;
XalanDocument * xd;
XalanNode * contextNode;
// Xalan can throw exceptions in all functions, so do one broad catch point.
try {
// Map to Xalan
xd = xpl.createDocument(document);
// For performing mapping
XercesDocumentWrapper *xdw = xpl.mapDocumentToWrapper(xd);
XercesWrapperNavigator xwn(xdw);
// Map the "here" node - but only if part of current document
XalanNode * hereNode = NULL;
if (h->getOwnerDocument() == document) {
hereNode = xwn.mapNode(h);
if (hereNode == NULL) {
hereNode = findHereNodeFromXalan(&xwn, xd, h);
if (hereNode == NULL) {
throw XSECException(XSECException::XPathError,
"Unable to find here node in Xalan Wrapper map");
}
}
}
// Now work out what we have to set up in the new processing
TXFMBase::nodeType inputType = input->getNodeType();
XalanDOMString cd; // For the moment assume the root is the context
const XalanDOMChar * cexpr;
safeBuffer contextExpr;
switch (inputType) {
case DOM_NODE_DOCUMENT :
case DOM_NODE_XPATH_NODESET :
// do XPath over the whole document and, if the input was an
// XPath Nodeset, then later intersect the result with the input nodelist
cd = XalanDOMString("/"); // Root node
cexpr = cd.c_str();
// The context node is the "root" node
contextNode =
xpe.selectSingleNode(
xds,
xd,
cexpr,
xd->getDocumentElement());
break;
case DOM_NODE_DOCUMENT_FRAGMENT :
{
// Need to map the DOM_Node that we are given from the input to the appropriate XalanNode
// Create the XPath expression to find the node
if (input->getFragmentId() != NULL) {
contextExpr.sbTranscodeIn("//descendant-or-self::node()[attribute::Id='");
contextExpr.sbXMLChCat(input->getFragmentId());
contextExpr.sbXMLChCat("']");
// Map the node
contextNode =
xpe.selectSingleNode(
xds,
//.........这里部分代码省略.........
示例8: getURLFromString
/**
* Determine the fully qualified URI for a string.
*
* @param urlString string to qualify
* @return auto pointer to fully qualified URI
*/
static URLAutoPtrType
getURLFromString(const XalanDOMString& urlString,
MemoryManagerType& theManager)
{
return getURLFromString(urlString.c_str(), theManager);
}
示例9: theResult
static XalanFileOutputStream::HandleType
openFile(
const XalanDOMString& theFileName,
MemoryManager& theManager)
{
typedef XalanFileOutputStream::HandleType HandleType;
#if defined(XALAN_WINDOWS)
HandleType theFileHandle = CreateFileW(
theFileName.c_str(),
GENERIC_WRITE,
0,
0,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
0);
if (theFileHandle != INVALID_HANDLE_VALUE && theFileHandle != 0)
{
return theFileHandle;
}
else
{
CharVectorType theResult(theManager);
TranscodeToLocalCodePage(theFileName, theResult, true);
if (theResult.empty() == true)
{
return INVALID_HANDLE_VALUE;
}
else
{
const char* const tmpName = &theResult[0];
if (tmpName == 0)
{
return INVALID_HANDLE_VALUE;
}
else
{
return CreateFile(
tmpName,
GENERIC_WRITE,
0,
0,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
0);
}
}
}
#else
#if defined(XALAN_STRICT_ANSI_HEADERS)
using std::fopen;
#endif
CharVectorType theResult(theManager);
TranscodeToLocalCodePage(theFileName, theResult, true);
if (theResult.empty() == true)
{
return 0;
}
else
{
const char* const tmpName = &theResult[0];
if (tmpName == 0)
{
return 0;
}
else
{
return fopen(tmpName, "wb");
}
}
#endif
}
示例10: xwn
XSECXPathNodeList * TXFMXPathFilter::evaluateSingleExpr(DSIGXPathFilterExpr *expr) {
// Have a single expression that we wish to find the resultant nodeset
// for
XSECXPathNodeList addedNodes;
setXPathNS(document, expr->mp_NSMap, addedNodes, mp_formatter, mp_nse);
XPathProcessorImpl xppi; // The processor
XercesParserLiaison xpl;
#if XALAN_VERSION_MAJOR == 1 && XALAN_VERSION_MINOR > 10
XercesDOMSupport xds(xpl);
#else
XercesDOMSupport xds;
#endif
XPathEvaluator xpe;
XPathFactoryDefault xpf;
XPathConstructionContextDefault xpcc;
XalanDocument * xd;
XalanNode * contextNode;
// Xalan can throw exceptions in all functions, so do one broad catch point.
try {
// Map to Xalan
xd = xpl.createDocument(document);
// For performing mapping
XercesDocumentWrapper *xdw = xpl.mapDocumentToWrapper(xd);
XercesWrapperNavigator xwn(xdw);
// Map the "here" node
XalanNode * hereNode = NULL;
hereNode = xwn.mapNode(expr->mp_xpathFilterNode);
if (hereNode == NULL) {
hereNode = findHereNodeFromXalan(&xwn, xd, expr->mp_exprTextNode);
if (hereNode == NULL) {
throw XSECException(XSECException::XPathFilterError,
"Unable to find here node in Xalan Wrapper map");
}
}
// Now work out what we have to set up in the new processing
XalanDOMString cd; // For XPath Filter, the root is always the context node
cd = XalanDOMString("/"); // Root node
// The context node is the "root" node
contextNode =
xpe.selectSingleNode(
xds,
xd,
cd.c_str(),
xd->getDocumentElement());
XPathEnvSupportDefault xpesd;
XObjectFactoryDefault xof;
XPathExecutionContextDefault xpec(xpesd, xds, xof);
ElementPrefixResolverProxy pr(xd->getDocumentElement(), xpesd, xds);
// Work around the fact that the XPath implementation is designed for XSLT, so does
// not allow here() as a NCName.
// THIS IS A KLUDGE AND SHOULD BE DONE BETTER
int offset = 0;
safeBuffer k(KLUDGE_PREFIX);
k.sbStrcatIn(":");
// Map the expression into a local code page string (silly - should be XMLCh)
safeBuffer exprSB;
exprSB << (*mp_formatter << expr->m_expr.rawXMLChBuffer());
offset = exprSB.sbStrstr("here()");
while (offset >= 0) {
if (offset == 0 || offset == 1 ||
(!(exprSB[offset - 1] == ':' && exprSB[offset - 2] != ':') &&
separator(exprSB[offset - 1]))) {
exprSB.sbStrinsIn(k.rawCharBuffer(), offset);
}
offset = exprSB.sbOffsetStrstr("here()", offset + 11);
}
//.........这里部分代码省略.........