本文整理汇总了C++中ParseName函数的典型用法代码示例。如果您正苦于以下问题:C++ ParseName函数的具体用法?C++ ParseName怎么用?C++ ParseName使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ParseName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StartTrace
Anything GenericXMLParser::ParseDtd()
{
StartTrace(GenericXMLParser.ParseDtd);
// we got already <! following a D
String doctype("!");
doctype.Append(ParseName());
Anything result;
Anything externalid;
if (doctype != "!DOCTYPE") {
Error("invalid <! tag");
result[doctype] = SkipToClosingAngleBracket(); // best effort
return result;
}
SkipWhitespace();
String rootnodename = ParseName();
result[doctype] = rootnodename;
SkipWhitespace();
int c = Peek();
if ('S' == c || 'P' == c) {
externalid = ParseExternalId();
}
result.Append(externalid);
SkipWhitespace();
if ('[' == Peek()) {
result.Append(ParseDtdElements());
}
SkipWhitespace();
if ('>' != Peek()) {
Error("DTD syntax error");
result.Append(SkipToClosingAngleBracket());
} else {
Get(); // read the end >
}
return result;
}
示例2: ParseSpecialName
// <special-name> ::= TV <type>
// ::= TT <type>
// ::= TI <type>
// ::= TS <type>
// ::= Tc <call-offset> <call-offset> <(base) encoding>
// ::= GV <(object) name>
// ::= T <call-offset> <(base) encoding>
// G++ extensions:
// ::= TC <type> <(offset) number> _ <(base) type>
// ::= TF <type>
// ::= TJ <type>
// ::= GR <name>
// ::= GA <encoding>
// ::= Th <call-offset> <(base) encoding>
// ::= Tv <call-offset> <(base) encoding>
//
// Note: we don't care much about them since they don't appear in
// stack traces. The are special data.
static bool ParseSpecialName(State *state) {
State copy = *state;
if (ParseChar(state, 'T') &&
ParseCharClass(state, "VTIS") &&
ParseType(state)) {
return true;
}
*state = copy;
if (ParseTwoChar(state, "Tc") && ParseCallOffset(state) &&
ParseCallOffset(state) && ParseEncoding(state)) {
return true;
}
*state = copy;
if (ParseTwoChar(state, "GV") &&
ParseName(state)) {
return true;
}
*state = copy;
if (ParseChar(state, 'T') && ParseCallOffset(state) &&
ParseEncoding(state)) {
return true;
}
*state = copy;
// G++ extensions
if (ParseTwoChar(state, "TC") && ParseType(state) &&
ParseNumber(state) && ParseChar(state, '_') &&
DisableAppend(state) &&
ParseType(state)) {
RestoreAppend(state, copy.append);
return true;
}
*state = copy;
if (ParseChar(state, 'T') && ParseCharClass(state, "FJ") &&
ParseType(state)) {
return true;
}
*state = copy;
if (ParseTwoChar(state, "GR") && ParseName(state)) {
return true;
}
*state = copy;
if (ParseTwoChar(state, "GA") && ParseEncoding(state)) {
return true;
}
*state = copy;
if (ParseChar(state, 'T') && ParseCharClass(state, "hv") &&
ParseCallOffset(state) && ParseEncoding(state)) {
return true;
}
*state = copy;
return false;
}
示例3: ParseEncoding
// <encoding> ::= <(function) name> <bare-function-type>
// ::= <(data) name>
// ::= <special-name>
static bool ParseEncoding(State *state) {
State copy = *state;
if (ParseName(state) && ParseBareFunctionType(state)) {
return true;
}
*state = copy;
if (ParseName(state) || ParseSpecialName(state)) {
return true;
}
return false;
}
示例4: NameServer
/* TODO(d'b): it is ugly. solution needed */
static void NameServer(struct Manifest *manifest, char *value)
{
GPtrArray *dummy = g_ptr_array_new();
ParseName(value, dummy);
manifest->name_server = g_ptr_array_index(dummy, 0);
g_ptr_array_free(dummy, TRUE);
}
示例5: ParseSection
/* IScanner */
static inline int ParseSection(struct IParse *parse, struct ISettings *settings)
{
ParseComment(parse);
ParseSkip(parse);
int code = ParsePeek(parse, 0);
if (!(code == '[')) {
return 0;
}
ParseRead(parse); /* [ */
ParseSkip(parse);
/* Section Name */
char name[MAX_NAME];
if (!ParseName(parse, name, MAX_NAME)) {
return 0;
}
ParseSkip(parse);
code = ParsePeek(parse, 0);
if (!(code == ']')) {
return 0;
}
ParseRead(parse); /* "]" */
HSECTION section = NULL;
if (!(section = CreateSection(settings, name))) {
return 0;
}
while (ParseValue(parse, section));
return 1;
}
示例6: ParseValue
/* IScanner */
static inline int ParseValue(struct IParse *parse, struct ISection *section)
{
ParseComment(parse);
ParseSkip(parse);
/* Value Name */
char name[MAX_NAME];
if (!ParseName(parse, name, MAX_NAME)) {
return 0;
}
ParseSkip(parse);
int code = ParsePeek(parse, 0);
if (!(code == '=')) {
return 0;
}
ParseRead(parse); /* = */
ParseSkip(parse);
/* Value Data */
char data[MAX_VALUE];
if (!ParseData(parse, data, MAX_VALUE)) {
return 0;
}
AddSectionString(section, name, data);
return 1;
}
示例7: IfFailRet
HRESULT FusionBind::EmitToken(IMetaDataAssemblyEmit *pEmit,
mdAssemblyRef *pToken)
{
HRESULT hr;
ASSEMBLYMETADATA AMD;
IfFailRet(ParseName());
AMD.usMajorVersion = m_context.usMajorVersion;
AMD.usMinorVersion = m_context.usMinorVersion;
AMD.usBuildNumber = m_context.usBuildNumber;
AMD.usRevisionNumber = m_context.usRevisionNumber;
if (m_context.szLocale) {
AMD.cbLocale = MultiByteToWideChar(CP_ACP, 0, m_context.szLocale, -1, NULL, 0);
AMD.szLocale = (LPWSTR) alloca(AMD.cbLocale);
MultiByteToWideChar(CP_ACP, 0, m_context.szLocale, -1, AMD.szLocale, AMD.cbLocale);
}
else {
AMD.cbLocale = 0;
AMD.szLocale = NULL;
}
long pwNameLen = WszMultiByteToWideChar(CP_UTF8, 0, m_pAssemblyName, -1, 0, 0);
CQuickBytes qb;
LPWSTR pwName = (LPWSTR) qb.Alloc(pwNameLen*sizeof(WCHAR));
WszMultiByteToWideChar(CP_UTF8, 0, m_pAssemblyName, -1, pwName, pwNameLen);
return pEmit->DefineAssemblyRef(m_pbPublicKeyOrToken, m_cbPublicKeyOrToken,
pwName,
&AMD,
NULL, 0,
m_dwFlags, pToken);
}
示例8: ParsePartitionSpec
bool LinkPartition::ParsePartitionSpec(LinkManager *manager, CmdFiles &files, LinkTokenizer &spec)
{
if (!ParseOverlays(manager, files, spec))
return false;
if (!ParseName(spec))
return false;
return ParseAttributes(spec);
}
示例9: ParseAttribute
bool XMLReader::ParseAttribute(Attribute & attribute)
{
// Attribute ::= Name Eq AttValue
if (ParseName(attribute)) {
return ParseEq()
&& ParseAttValue(attribute.mValue);
}
return false;
}
示例10: ParseName
BOOL FusionBind::Compare(FusionBind *pSpec)
{
// Normalize representations
if (!m_fParsed)
ParseName();
if (!pSpec->m_fParsed)
pSpec->ParseName();
// Compare fields
if (m_CodeInfo.m_fLoadFromParent != pSpec->m_CodeInfo.m_fLoadFromParent)
return 0;
if (m_pAssemblyName != pSpec->m_pAssemblyName
&& (m_pAssemblyName == NULL || pSpec->m_pAssemblyName == NULL
|| strcmp(m_pAssemblyName, pSpec->m_pAssemblyName)))
return 0;
if (m_cbPublicKeyOrToken != pSpec->m_cbPublicKeyOrToken
|| memcmp(m_pbPublicKeyOrToken, pSpec->m_pbPublicKeyOrToken, m_cbPublicKeyOrToken))
return 0;
if (m_dwFlags != pSpec->m_dwFlags)
return 0;
if (m_CodeInfo.m_pszCodeBase != pSpec->m_CodeInfo.m_pszCodeBase
&& (m_CodeInfo.m_pszCodeBase == NULL || pSpec->m_CodeInfo.m_pszCodeBase == NULL
|| wcscmp(m_CodeInfo.m_pszCodeBase, pSpec->m_CodeInfo.m_pszCodeBase)))
return 0;
if (m_context.usMajorVersion != pSpec->m_context.usMajorVersion)
return 0;
if (m_context.usMajorVersion != (USHORT) -1) {
if (m_context.usMinorVersion != pSpec->m_context.usMinorVersion)
return 0;
if (m_context.usMinorVersion != (USHORT) -1) {
if (m_context.usBuildNumber != pSpec->m_context.usBuildNumber)
return 0;
if (m_context.usBuildNumber != (USHORT) -1) {
if (m_context.usRevisionNumber != pSpec->m_context.usRevisionNumber)
return 0;
}
}
}
if (m_context.szLocale != pSpec->m_context.szLocale
&& (m_context.szLocale == NULL || pSpec->m_context.szLocale == NULL
|| strcmp(m_context.szLocale, pSpec->m_context.szLocale)))
return 0;
return 1;
}
示例11: main
int main ()
{
// get name to encode
while(true) {
cout << "Enter surname (RETURN to quit): ";
string surname = GetLine();
if (surname == "") exit(0); // exits program
cout << "Soundex code for " << surname
<< " is " << ParseName(surname) << endl;
}
return 0;
}
示例12: ParseName
bool ppInclude::CheckInclude(int token, const std::string &args)
{
if (token == INCLUDE)
{
std::string line1 = args;
define->Process(line1);
ParseName(line1);
FindFile(args);
pushFile(name);
return true;
}
return false;
}
示例13: ParseEndElement
bool XMLReader::ParseEndElement()
{
// ETag ::= '</' Name S? '>'
if (ParseString("</") && ParseName(mCurrentName) && ParseOptionalWhitespace() && ParseString(">")) {
if (mOpenTags.empty()) return false;
Tag & currentTag = mOpenTags.back();
if (currentTag.mName != mCurrentName.mName) return false;
mNodeType = kEndElement;
PopTag();
return true;
}
return false;
}
示例14: ParseName
void CBlender_Compile::Stage_Texture (LPCSTR name, u32 , u32 fmin, u32 fmip, u32 fmag)
{
sh_list& lst= L_textures;
int id = ParseName(name);
LPCSTR N = name;
if (id>=0) {
if (id>=int(lst.size())) Debug.fatal(DEBUG_INFO,"Not enought textures for shader. Base texture: '%s'.",*lst[0]);
N = *lst [id];
}
passTextures.push_back (mk_pair( Stage(),ref_texture( DEV->_CreateTexture(N))));
// i_Address (Stage(),address);
i_Filter (Stage(),fmin,fmip,fmag);
}
示例15: userName
already_AddRefed<WebGLUniformLocation>
WebGLProgram::GetUniformLocation(const nsAString& userName_wide) const
{
if (!ValidateGLSLVariableName(userName_wide, mContext, "getUniformLocation"))
return nullptr;
if (!IsLinked()) {
mContext->ErrorInvalidOperation("getUniformLocation: `program` must be linked.");
return nullptr;
}
const NS_LossyConvertUTF16toASCII userName(userName_wide);
nsDependentCString baseUserName;
bool isArray = false;
// GLES 2.0.25, Section 2.10, p35
// If the the uniform location is an array, then the location of the first
// element of that array can be retrieved by either using the name of the
// uniform array, or the name of the uniform array appended with "[0]".
// The ParseName() can't recognize this rule. So always initialize
// arrayIndex with 0.
size_t arrayIndex = 0;
if (!ParseName(userName, &baseUserName, &isArray, &arrayIndex))
return nullptr;
const WebGLActiveInfo* activeInfo;
if (!LinkInfo()->FindUniform(baseUserName, &activeInfo))
return nullptr;
const nsCString& baseMappedName = activeInfo->mBaseMappedName;
nsAutoCString mappedName(baseMappedName);
if (isArray) {
mappedName.AppendLiteral("[");
mappedName.AppendInt(uint32_t(arrayIndex));
mappedName.AppendLiteral("]");
}
gl::GLContext* gl = mContext->GL();
gl->MakeCurrent();
GLint loc = gl->fGetUniformLocation(mGLName, mappedName.BeginReading());
if (loc == -1)
return nullptr;
RefPtr<WebGLUniformLocation> locObj = new WebGLUniformLocation(mContext, LinkInfo(),
loc, arrayIndex,
activeInfo);
return locObj.forget();
}