本文整理汇总了C++中JSONCPP_STRING::length方法的典型用法代码示例。如果您正苦于以下问题:C++ JSONCPP_STRING::length方法的具体用法?C++ JSONCPP_STRING::length怎么用?C++ JSONCPP_STRING::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSONCPP_STRING
的用法示例。
在下文中一共展示了JSONCPP_STRING::length方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makePath
void Path::makePath(const JSONCPP_STRING& path, const InArgs& in) {
const char* current = path.c_str();
const char* end = current + path.length();
InArgs::const_iterator itInArg = in.begin();
while (current != end) {
if (*current == '[') {
++current;
if (*current == '%')
addPathInArg(path, in, itInArg, PathArgument::kindIndex);
else {
ArrayIndex index = 0;
for (; current != end && *current >= '0' && *current <= '9'; ++current)
index = index * 10 + ArrayIndex(*current - '0');
args_.push_back(index);
}
if (current == end || *++current != ']')
invalidPath(path, int(current - path.c_str()));
} else if (*current == '%') {
addPathInArg(path, in, itInArg, PathArgument::kindKey);
++current;
} else if (*current == '.' || *current == ']') {
++current;
} else {
const char* beginName = current;
while (current != end && !strchr("[.", *current))
++current;
args_.push_back(JSONCPP_STRING(beginName, current));
}
}
}
示例2: removeSuffix
static JSONCPP_STRING removeSuffix(const JSONCPP_STRING& path,
const JSONCPP_STRING& extension) {
if (extension.length() >= path.length())
return JSONCPP_STRING("");
JSONCPP_STRING suffix = path.substr(path.length() - extension.length());
if (suffix != extension)
return JSONCPP_STRING("");
return path.substr(0, path.length() - extension.length());
}
示例3: initBasic
Value::Value(const JSONCPP_STRING& value) {
initBasic(stringValue, true);
value_.string_ =
duplicateAndPrefixStringValue(value.data(), static_cast<unsigned>(value.length()));
}
示例4: setComment
void Value::setComment(const JSONCPP_STRING& comment, CommentPlacement placement) {
setComment(comment.c_str(), comment.length(), placement);
}
示例5: isMember
bool Value::isMember(JSONCPP_STRING const& key) const
{
return isMember(key.data(), key.data() + key.length());
}
示例6: removeMember
bool Value::removeMember(JSONCPP_STRING const& key, Value* removed)
{
return removeMember(key.data(), key.data() + key.length(), removed);
}
示例7: get
Value Value::get(JSONCPP_STRING const& key, Value const& defaultValue) const
{
return get(key.data(), key.data() + key.length(), defaultValue);
}