本文整理汇总了C++中SPString::getPrev方法的典型用法代码示例。如果您正苦于以下问题:C++ SPString::getPrev方法的具体用法?C++ SPString::getPrev怎么用?C++ SPString::getPrev使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPString
的用法示例。
在下文中一共展示了SPString::getPrev方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read_content
void SPString::read_content() {
SPString* object = this;
SPString *string = SP_STRING(object);
string->string.clear();
//XML Tree being used directly here while it shouldn't be.
gchar const *xml_string = string->getRepr()->content();
// see algorithms described in svg 1.1 section 10.15
if (object->xml_space.value == SP_XML_SPACE_PRESERVE) {
for ( ; *xml_string ; xml_string = g_utf8_next_char(xml_string) ) {
gunichar c = g_utf8_get_char(xml_string);
if ((c == 0xa) || (c == 0xd) || (c == '\t')) {
c = ' ';
}
string->string += c;
}
}
else {
bool whitespace = false;
for ( ; *xml_string ; xml_string = g_utf8_next_char(xml_string) ) {
gunichar c = g_utf8_get_char(xml_string);
if ((c == 0xa) || (c == 0xd)) {
continue;
}
if ((c == ' ') || (c == '\t')) {
whitespace = true;
} else {
if (whitespace && (!string->string.empty() || (object->getPrev() != NULL))) {
string->string += ' ';
}
string->string += c;
whitespace = false;
}
}
if (whitespace && object->getRepr()->next() != NULL) { // can't use SPObject::getNext() when the SPObject tree is still being built
string->string += ' ';
}
}
object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
}