本文整理汇总了C++中Identifier::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Identifier::size方法的具体用法?C++ Identifier::size怎么用?C++ Identifier::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Identifier
的用法示例。
在下文中一共展示了Identifier::size方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visit
void NamePrettyPrinter::visit(NameId *name)
{
Identifier *id = name->identifier();
if (id)
_name = QString::fromLatin1(id->chars(), id->size());
else
_name = QLatin1String("anonymous");
}
示例2: StringImpl
String::String(const Identifier& str)
{
if (str.isNull())
return;
if (str.isEmpty())
m_impl = StringImpl::empty();
else
m_impl = new StringImpl(reinterpret_cast<const UChar*>(str.data()), str.size());
}
示例3: hasCSSPropertyNamePrefix
// Check for a CSS prefix.
// Passed prefix is all lowercase.
// First character of the prefix within the property name may be upper or lowercase.
// Other characters in the prefix within the property name must be lowercase.
// The prefix within the property name must be followed by a capital letter.
static bool hasCSSPropertyNamePrefix(const Identifier& propertyName, const char* prefix)
{
#ifndef NDEBUG
ASSERT(*prefix);
for (const char* p = prefix; *p; ++p)
ASSERT(isASCIILower(*p));
ASSERT(propertyName.size());
#endif
if (toASCIILower(propertyName.data()[0]) != prefix[0])
return false;
unsigned length = propertyName.size();
for (unsigned i = 1; i < length; ++i) {
if (!prefix[i])
return isASCIIUpper(propertyName.data()[i]);
if (propertyName.data()[i] != prefix[i])
return false;
}
return false;
}
示例4: sizeof
Loader::Loader(const std::string& fileName, const Identifier& acceptedIdentifier):
fileContents(fileName)
{
constexpr auto minimalSize = sizeof(Identifier) + sizeof(Node::START) + sizeof(Node::type) + sizeof(Node::END);
if (fileContents.size() <= minimalSize) {
throw InvalidOTBFormat{};
}
Identifier fileIdentifier;
std::copy(fileContents.begin(), fileContents.begin() + fileIdentifier.size(), fileIdentifier.begin());
if (fileIdentifier != acceptedIdentifier && fileIdentifier != wildcard) {
throw InvalidOTBFormat{};
}
}
示例5: cssPropertyName
static String cssPropertyName(const Identifier& propertyName, bool* hadPixelOrPosPrefix = 0)
{
if (hadPixelOrPosPrefix)
*hadPixelOrPosPrefix = false;
unsigned length = propertyName.size();
if (!length)
return String();
Vector<UChar> name;
name.reserveInitialCapacity(length);
unsigned i = 0;
if (hasCSSPropertyNamePrefix(propertyName, "css"))
i += 3;
else if (hasCSSPropertyNamePrefix(propertyName, "pixel")) {
i += 5;
if (hadPixelOrPosPrefix)
*hadPixelOrPosPrefix = true;
} else if (hasCSSPropertyNamePrefix(propertyName, "pos")) {
i += 3;
if (hadPixelOrPosPrefix)
*hadPixelOrPosPrefix = true;
} else if (hasCSSPropertyNamePrefix(propertyName, "webkit")
|| hasCSSPropertyNamePrefix(propertyName, "khtml")
|| hasCSSPropertyNamePrefix(propertyName, "apple"))
name.append('-');
else {
if (isASCIIUpper(propertyName.data()[0]))
return String();
}
name.append(toASCIILower(propertyName.data()[i++]));
for (; i < length; ++i) {
UChar c = propertyName.data()[i];
if (!isASCIIUpper(c))
name.append(c);
else {
name.append('-');
name.append(toASCIILower(c));
}
}
return String::adopt(name);
}
示例6: find
int Lookup::find(const struct HashTable *table, const Identifier &s)
{
const HashEntry *entry = KJS::findEntry(table, s.ustring().rep()->hash(), s.data(), s.size());
if (entry)
return entry->value;
return -1;
}
示例7: find
int Lookup::find(const struct HashTable *table, const Identifier &s)
{
return find(table, s.data(), s.size());
}
示例8: hash
unsigned int Lookup::hash(const Identifier &key)
{
return hash(key.data(), key.size());
}
示例9:
String::String(const Identifier& str)
{
if (str.isNull())
return;
m_impl = StringImpl::create(str.data(), str.size());
}