本文整理汇总了C++中ParseName函数的典型用法代码示例。如果您正苦于以下问题:C++ ParseName函数的具体用法?C++ ParseName怎么用?C++ ParseName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ParseName函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:chenbk85,项目名称:CuteTestForCoastTest,代码行数:35,代码来源:GenericXMLParser.cpp
示例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;
}
开发者ID:AbhimanyuAryan,项目名称:treefrog-framework,代码行数:78,代码来源:demangle.cpp
示例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;
}
开发者ID:AbhimanyuAryan,项目名称:treefrog-framework,代码行数:15,代码来源:demangle.cpp
示例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);
}
开发者ID:fabgithub,项目名称:zerovm,代码行数:8,代码来源:manifest.c
示例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;
}
开发者ID:CarbonOS,项目名称:libsystem,代码行数:36,代码来源:read.c
示例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;
}
开发者ID:CarbonOS,项目名称:libsystem,代码行数:30,代码来源:read.c
示例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);
}
开发者ID:ArildF,项目名称:masters,代码行数:34,代码来源:fusionbind.cpp
示例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);
}
开发者ID:NoSuchProcess,项目名称:OrangeC,代码行数:8,代码来源:LinkPartition.cpp
示例9: ParseAttribute
bool XMLReader::ParseAttribute(Attribute & attribute)
{
// Attribute ::= Name Eq AttValue
if (ParseName(attribute)) {
return ParseEq()
&& ParseAttValue(attribute.mValue);
}
return false;
}
开发者ID:BackupTheBerlios,项目名称:llamaxml-svn,代码行数:9,代码来源:XMLReader.cpp
示例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;
}
开发者ID:ArildF,项目名称:masters,代码行数:56,代码来源:fusionbind.cpp
示例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;
}
开发者ID:AshRobinson,项目名称:Stanford-CS106B,代码行数:12,代码来源:soundex.cpp
示例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;
}
开发者ID:NoSuchProcess,项目名称:OrangeC,代码行数:13,代码来源:ppInclude.cpp
示例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;
}
开发者ID:BackupTheBerlios,项目名称:llamaxml-svn,代码行数:13,代码来源:XMLReader.cpp
示例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);
}
开发者ID:2asoft,项目名称:xray-16,代码行数:13,代码来源:Blender_Recorder.cpp
示例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();
}
开发者ID:Pike,项目名称:gecko-dev,代码行数:50,代码来源:WebGLProgram.cpp
示例16: ParseLocalName
// <local-name> := Z <(function) encoding> E <(entity) name>
// [<discriminator>]
// := Z <(function) encoding> E s [<discriminator>]
static bool ParseLocalName(State *state) {
State copy = *state;
if (ParseChar(state, 'Z') && ParseEncoding(state) &&
ParseChar(state, 'E') && MaybeAppend(state, "::") &&
ParseName(state) && Optional(ParseDiscriminator(state))) {
return true;
}
*state = copy;
if (ParseChar(state, 'Z') && ParseEncoding(state) &&
ParseTwoChar(state, "Es") && Optional(ParseDiscriminator(state))) {
return true;
}
*state = copy;
return false;
}
开发者ID:AbhimanyuAryan,项目名称:treefrog-framework,代码行数:19,代码来源:demangle.cpp
示例17: while
void File::ParseDefs(InputStream& s, Reference* pParentRef)
{
while(s.SkipWhiteSpace(L";") != '}' && s.PeekChar() != Stream::EOS)
{
NodePriority priority = PNormal;
CAtlList<CStringW> types;
CStringW name;
int c = s.SkipWhiteSpace();
if(c == '*') {s.GetChar(); priority = PLow;}
else if(c == '!') {s.GetChar(); priority = PHigh;}
ParseTypes(s, types);
if(s.SkipWhiteSpace() == '#')
{
s.GetChar();
ParseName(s, name);
}
if(types.IsEmpty())
{
if(name.IsEmpty()) s.ThrowError(_T("syntax error"));
types.AddTail(L"?");
}
Reference* pRef = pParentRef;
while(types.GetCount() > 1)
pRef = CreateRef(CreateDef(pRef, types.RemoveHead()));
Definition* pDef = NULL;
if(!types.IsEmpty())
pDef = CreateDef(pRef, types.RemoveHead(), name, priority);
c = s.SkipWhiteSpace(L":=");
if(c == '"' || c == '\'') ParseQuotedString(s, pDef);
else if(iswdigit(c) || c == '+' || c == '-') ParseNumber(s, pDef);
else if(pDef->IsType(L"@")) ParseBlock(s, pDef);
else ParseRefs(s, pDef);
}
s.GetChar();
}
开发者ID:Cyberbeing,项目名称:xy-VSFilter,代码行数:47,代码来源:File.cpp
示例18: userName
void
WebGLProgram::GetUniformIndices(const dom::Sequence<nsString>& uniformNames,
dom::Nullable< nsTArray<GLuint> >& retval) const
{
const char funcName[] = "getUniformIndices";
if (!IsLinked()) {
mContext->ErrorInvalidOperation("%s: `program` must be linked.", funcName);
return;
}
size_t count = uniformNames.Length();
nsTArray<GLuint>& arr = retval.SetValue();
gl::GLContext* gl = mContext->GL();
gl->MakeCurrent();
for (size_t i = 0; i < count; i++) {
const NS_LossyConvertUTF16toASCII userName(uniformNames[i]);
nsDependentCString baseUserName;
bool isArray;
size_t arrayIndex;
if (!ParseName(userName, &baseUserName, &isArray, &arrayIndex)) {
arr.AppendElement(LOCAL_GL_INVALID_INDEX);
continue;
}
webgl::UniformInfo* info;
if (!LinkInfo()->FindUniform(baseUserName, &info)) {
arr.AppendElement(LOCAL_GL_INVALID_INDEX);
continue;
}
nsAutoCString mappedName(info->mActiveInfo->mBaseMappedName);
if (isArray) {
mappedName.AppendLiteral("[");
mappedName.AppendInt(uint32_t(arrayIndex));
mappedName.AppendLiteral("]");
}
const GLchar* mappedNameBytes = mappedName.BeginReading();
GLuint index = 0;
gl->fGetUniformIndices(mGLName, 1, &mappedNameBytes, &index);
arr.AppendElement(index);
}
}
开发者ID:mephisto41,项目名称:gecko-dev,代码行数:47,代码来源:WebGLProgram.cpp
示例19: 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;
size_t arrayIndex;
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, activeInfo);
return locObj.forget();
}
开发者ID:Danielzac,项目名称:gecko-dev,代码行数:43,代码来源:WebGLProgram.cpp
示例20: Channel
/* set channels field */
static void Channel(struct Manifest *manifest, char *value)
{
char **tokens;
char **names;
int i;
struct ChannelDesc *channel;
/* allocate a new channel */
channel = g_malloc0(sizeof *channel);
channel->source = g_ptr_array_new();
/* get tokens from channel description */
tokens = g_strsplit(value, VALUE_DELIMITER, ChannelTokensNumber);
/* TODO(d'b): fix "invalid numeric value ', 0'" bug here */
ZLOGFAIL(tokens[ChannelTokensNumber] != NULL || tokens[PutSize] == NULL,
EFAULT, "invalid channel tokens number");
/* parse alias and name(s) */
channel->alias = g_strdup(g_strstrip(tokens[Alias]));
names = g_strsplit(tokens[Name], TOKEN_DELIMITER, MANIFEST_TOKENS_LIMIT);
for(i = 0; names[i] != NULL; ++i)
ParseName(names[i], channel->source);
channel->type = ToInt(tokens[Type]);
i = ToInt(tokens[Tag]);
ZLOGFAIL(i != 0 && i != 1, EFAULT, "invalid channel mumeric token");
channel->tag = i == 0 ? NULL : TagCtor();
for(i = 0; i < LimitsNumber; ++i)
{
channel->limits[i] = ToInt(tokens[i + Gets]);
ZLOGFAIL(channel->limits[i] < 0, EFAULT,
"negative limits for %s", channel->alias);
}
/* append a new channel */
g_ptr_array_add(manifest->channels, channel);
g_strfreev(names);
g_strfreev(tokens);
}
开发者ID:fabgithub,项目名称:zerovm,代码行数:44,代码来源:manifest.c
注:本文中的ParseName函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论