当前位置: 首页>>代码示例>>C++>>正文


C++ SegmentedString::append方法代码示例

本文整理汇总了C++中SegmentedString::append方法的典型用法代码示例。如果您正苦于以下问题:C++ SegmentedString::append方法的具体用法?C++ SegmentedString::append怎么用?C++ SegmentedString::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SegmentedString的用法示例。


在下文中一共展示了SegmentedString::append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: documentWrite

static inline void documentWrite(ExecState& state, JSHTMLDocument* thisDocument, NewlineRequirement addNewline)
{
    HTMLDocument* document = &thisDocument->wrapped();
    // DOM only specifies single string argument, but browsers allow multiple or no arguments.

    size_t size = state.argumentCount();

    String firstString = state.argument(0).toString(&state)->value(&state);
    SegmentedString segmentedString = firstString;
    if (size != 1) {
        if (!size)
            segmentedString.clear();
        else {
            for (size_t i = 1; i < size; ++i) {
                String subsequentString = state.uncheckedArgument(i).toString(&state)->value(&state);
                segmentedString.append(SegmentedString(subsequentString));
            }
        }
    }
    if (addNewline)
        segmentedString.append(SegmentedString(String(&newlineCharacter, 1)));

    Document* activeDocument = findCallingDocument(state);
    document->write(segmentedString, activeDocument);
}
开发者ID:hnney,项目名称:webkit,代码行数:25,代码来源:JSHTMLDocumentCustom.cpp

示例2: documentWrite

static inline void documentWrite(ExecState* exec, HTMLDocument* document, NewlineRequirement addNewline)
{
    // DOM only specifies single string argument, but browsers allow multiple or no arguments.

    size_t size = exec->argumentCount();

    UString firstString = exec->argument(0).toString(exec);
    SegmentedString segmentedString = ustringToString(firstString);
    if (size != 1) {
        if (!size)
            segmentedString.clear();
        else {
            for (size_t i = 1; i < size; ++i) {
                UString subsequentString = exec->argument(i).toString(exec);
                segmentedString.append(SegmentedString(ustringToString(subsequentString)));
            }
        }
    }
    if (addNewline)
        segmentedString.append(SegmentedString(&newlineCharacter, 1));

    Document* activeDocument = asJSDOMWindow(exec->lexicalGlobalObject())->impl()->document();
    document->write(segmentedString, activeDocument);
}
开发者ID:mikedougherty,项目名称:webkit,代码行数:24,代码来源:JSHTMLDocumentCustom.cpp

示例3: documentWrite

static inline void documentWrite(ExecState* exec, HTMLDocument* document, NewlineRequirement addNewline)
{
    // DOM only specifies single string argument, but browsers allow multiple or no arguments.

    size_t size = exec->argumentCount();

    UString firstString = exec->argument(0).toString(exec);
#if defined(JSC_TAINTED)
    unsigned int tainted = 0;
    if (firstString.isTainted()) {
	TaintedStructure trace_struct;
        trace_struct.taintedno = firstString.isTainted();
        trace_struct.internalfunc = "documentWrite";
        trace_struct.jsfunc = "document.write/writeln";
        trace_struct.action = "sink";
        trace_struct.value = TaintedUtils::UString2string(firstString);

        TaintedTrace* trace = TaintedTrace::getInstance();
        trace->addTaintedTrace(trace_struct);
	tainted = firstString.isTainted();
    }
#endif
    SegmentedString segmentedString = ustringToString(firstString);
    if (size != 1) {
        if (!size)
            segmentedString.clear();
        else {
            for (size_t i = 1; i < size; ++i) {
                UString subsequentString = exec->argument(i).toString(exec);
#if defined(JSC_TAINTED)
	        unsigned int c_tainted = 0;
    		if (subsequentString.isTainted()) {
		    c_tainted = subsequentString.isTainted();
		}
		if (c_tainted) {
		    TaintedStructure trace_struct;
		    trace_struct.taintedno = c_tainted;
		    trace_struct.internalfunc = "documentWrite";
		    trace_struct.jsfunc = "document.write/writeln";
		    trace_struct.action = "sink";
		    trace_struct.value = TaintedUtils::UString2string(subsequentString);

		    TaintedTrace* trace = TaintedTrace::getInstance();
		    trace->addTaintedTrace(trace_struct);
		    tainted = c_tainted;
    		}
#endif
                segmentedString.append(SegmentedString(ustringToString(subsequentString)));
            }
        }
    }

    if (addNewline)
        segmentedString.append(SegmentedString(String(&newlineCharacter, 1)));

    Document* activeDocument = asJSDOMWindow(exec->lexicalGlobalObject())->impl()->document();
    document->write(segmentedString, activeDocument);
#if defined(JSC_TAINTED)
    if (tainted) {
	activeDocument->setTainted(tainted);
    }
#endif
}
开发者ID:dpnishant,项目名称:tpjs,代码行数:63,代码来源:JSHTMLDocumentCustom.cpp


注:本文中的SegmentedString::append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。