本文整理汇总了C++中StringRange::length方法的典型用法代码示例。如果您正苦于以下问题:C++ StringRange::length方法的具体用法?C++ StringRange::length怎么用?C++ StringRange::length使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringRange
的用法示例。
在下文中一共展示了StringRange::length方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setString
void Registry::setString(StringRange valueName, StringRange value, Registry::ValueKind kind) {
assert("Empty Registry" && *this);
assert("Invalid Registry::ValueKind" && (kind == ValueKind::string || kind == ValueKind::expandString || kind == ValueKind::multiString));
checkResult(RegSetValueExW(_handle, valueName.c_str(), 0, kind
, reinterpret_cast<const BYTE*>(value.c_str()), value.length() * sizeof(wchar_t)));
}
示例2: StringRange
Registry::Registry(StringRange path, bool writable) : _handle(nullptr) {
assert("Empty path" && !path.empty());
int rootKeyNameEnd = String::refer(path).indexOf(L'\\');
StringRange subKeyName = L"";
if (rootKeyNameEnd == -1) {
rootKeyNameEnd = path.length();
} else {
subKeyName = StringRange(path.c_str() + rootKeyNameEnd + 1);
}
if (!rootKeyNameEnd) {
assert("Invalid Registry root key name" && false);
} else if (!String::compare(path, 0, L"HKEY_CLASSES_ROOT", 0, rootKeyNameEnd)) {
*this = Registry::classesRoot();
} else if (!String::compare(path, 0, L"HKEY_CURRENT_CONFIG", 0, rootKeyNameEnd)) {
*this = Registry::currentConfig();
} else if (!String::compare(path, 0, L"HKEY_CURRENT_USER", 0, rootKeyNameEnd)) {
*this = Registry::currentUser();
} else if (!String::compare(path, 0, L"HKEY_LOCAL_MACHINE", 0, rootKeyNameEnd)) {
*this = Registry::localMachine();
} else if (!String::compare(path, 0, L"HKEY_USERS", 0, rootKeyNameEnd)) {
*this = Registry::users();
} else {
assert("Invalid Registry root key name" && false);
}
if (!subKeyName.empty()) {
*this = openKey(subKeyName, writable);
}
}