本文整理汇总了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);
}
示例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);
}
示例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
}