这篇教程C++ vStringTerminate函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中vStringTerminate函数的典型用法代码示例。如果您正苦于以下问题:C++ vStringTerminate函数的具体用法?C++ vStringTerminate怎么用?C++ vStringTerminate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了vStringTerminate函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: findAwkTagsstatic void findAwkTags (void){ vString *name = vStringNew (); const unsigned char *line; while ((line = readLineFromInputFile ()) != NULL) { if (strncmp ((const char*) line, "function", (size_t) 8) == 0 && isspace ((int) line [8])) { const unsigned char *cp = line + 8; while (isspace ((int) *cp)) ++cp; while (isalnum ((int) *cp) || *cp == '_') { vStringPut (name, (int) *cp); ++cp; } vStringTerminate (name); while (isspace ((int) *cp)) ++cp; if (*cp == '(') makeSimpleTag (name, AwkKinds, K_FUNCTION); vStringClear (name); if (*cp != '/0') ++cp; } } vStringDelete (name);}
开发者ID:Dev0Null,项目名称:ctags,代码行数:31,
示例2: computeModuleName/* in OCaml the file name is the module name used in the language * with it first letter put in upper case */static void computeModuleName ( void ){ /* in Ocaml the file name define a module. * so we define a module =) */ const char *filename = getInputFileName (); int beginIndex = 0; int endIndex = strlen (filename) - 1; vString *moduleName = vStringNew (); while (filename[endIndex] != '.' && endIndex > 0) endIndex--; /* avoid problem with path in front of filename */ beginIndex = endIndex; while (beginIndex > 0) { if (filename[beginIndex] == '//' || filename[beginIndex] == '/') { beginIndex++; break; } beginIndex--; } vStringNCopyS (moduleName, &filename[beginIndex], endIndex - beginIndex); vStringTerminate (moduleName); if (isLowerAlpha (moduleName->buffer[0])) moduleName->buffer[0] += ('A' - 'a'); addTag (moduleName, K_MODULE); vStringDelete (moduleName);}
开发者ID:Dev0Null,项目名称:ctags,代码行数:37,
示例3: makeClassTagstatic void makeClassTag (tokenInfo *const token, vString *const signature){ vString * fulltag; if ( ! token->ignoreTag ) { fulltag = vStringNew (); if (vStringLength (token->scope) > 0) { vStringCopy(fulltag, token->scope); vStringCatS (fulltag, "."); vStringCatS (fulltag, vStringValue(token->string)); } else { vStringCopy(fulltag, token->string); } vStringTerminate(fulltag); if ( ! stringListHas(ClassNames, vStringValue (fulltag)) ) { stringListAdd (ClassNames, vStringNewCopy (fulltag)); makeJsTag (token, JSTAG_CLASS, signature); } vStringDelete (fulltag); }}
开发者ID:amosbird,项目名称:ctags,代码行数:26,
示例4: vStringNewstatic vString *parseNumeric (int c){ vString *string = vStringNew (); vString *integer = parseInteger (c); vStringCopy (string, integer); vStringDelete (integer); c = getcFromInputFile (); if (c == '.') { integer = parseInteger ('/0'); vStringPut (string, c); vStringCat (string, integer); vStringDelete (integer); c = getcFromInputFile (); } if (tolower (c) == 'e') { integer = parseInteger ('/0'); vStringPut (string, c); vStringCat (string, integer); vStringDelete (integer); } else if (!isspace (c)) ungetcToInputFile (c); vStringTerminate (string); return string;}
开发者ID:acarlson1029,项目名称:ctags,代码行数:30,
示例5: vStringNewstatic vString *parseNumeric (int c){ static vString *string = NULL; if (string == NULL) string = vStringNew (); vStringCopy (string, parseInteger (c)); c = fileGetc (); if (c == '.') { vStringPut (string, c); vStringCat (string, parseInteger ('/0')); c = fileGetc (); } if (tolower (c) == 'e') { vStringPut (string, c); vStringCat (string, parseInteger ('/0')); } else if (!isspace (c)) fileUngetc (c); vStringTerminate (string); return string;}
开发者ID:att,项目名称:uwin,代码行数:27,
示例6: vStringClearstatic const unsigned char *parseIdentifier ( const unsigned char *cp, vString *const identifier){ boolean stringLit = FALSE; vStringClear (identifier); while (*cp != '/0' && (!isIdentifier ((int) *cp) || stringLit)) { int oneback = *cp; cp++; if (oneback == '(' && *cp == '*' && stringLit == FALSE) { CommentLevel++; return ++cp; } if (*cp == '"' && oneback != '//') { stringLit = TRUE; continue; } if (stringLit && *cp == '"' && oneback != '//') stringLit = FALSE; } if (strcmp ((const char *) cp, "") == 0 || cp == NULL) return cp; while (isIdentifier ((int) *cp)) { vStringPut (identifier, (int) *cp); cp++; } vStringTerminate (identifier); return cp;}
开发者ID:simlrh,项目名称:ctags,代码行数:33,
示例7: eatOperator/* Operator can be defined in OCaml as a function * so we must be ample enough to parse them normally */static ocamlKeyword eatOperator (lexingState * st){ int count = 0; const unsigned char *root = st->cp; vStringClear (st->name); while (isOperator[st->cp[count]]) { vStringPut (st->name, st->cp[count]); count++; } vStringTerminate (st->name); st->cp += count; if (count <= 1) { switch (root[0]) { case '|': return Tok_Pipe; case '=': return Tok_EQ; default: return Tok_Op; } } else if (count == 2 && root[0] == '-' && root[1] == '>') return Tok_To; else return Tok_Op;}
开发者ID:Dev0Null,项目名称:ctags,代码行数:35,
示例8: emitRubyTag/** Emits a tag for the given 'name' of kind 'kind' at the current nesting.*/static void emitRubyTag (vString* name, rubyKind kind){ tagEntryInfo tag; vString* scope; if (!RubyKinds[kind].enabled) { return; } vStringTerminate (name); scope = stringListToScope (nesting); initTagEntry (&tag, vStringValue (name)); if (vStringLength (scope) > 0) { tag.extensionFields.scope [0] = "class"; tag.extensionFields.scope [1] = vStringValue (scope); } tag.kindName = RubyKinds [kind].name; tag.kind = RubyKinds [kind].letter; makeTagEntry (&tag); stringListAdd (nesting, vStringNewCopy (name)); vStringClear (name); vStringDelete (scope);}
开发者ID:QingmingHe,项目名称:ctags,代码行数:29,
示例9: parseLetstatic void parseLet (const unsigned char *line, int infunction){ vString *name = vStringNew (); const unsigned char *cp = line; const unsigned char *np = line; /* get the name */ if (isspace ((int) *cp)) { while (*cp && isspace ((int) *cp)) ++cp; /* * Ignore lets which set: * & - local buffer vim settings * @ - registers * [ - Lists or Dictionaries */ if (!*cp || *cp == '&' || *cp == '@' || *cp == '[' ) goto cleanUp; /* * Ignore vim variables which are read only * v: - Vim variables. */ np = cp; ++np; if ((int) *cp == 'v' && (int) *np == ':' ) goto cleanUp; /* Skip non-global vars in functions */ if (infunction && (int) *cp != 'g') goto cleanUp; /* deal with spaces, $, @ and & */ while (*cp && *cp != '$' && !isalnum ((int) *cp)) ++cp; if (!*cp) goto cleanUp; /* cp = skipPrefix (cp, &scope); */ do { if (!*cp) break; vStringPut (name, (int) *cp); ++cp; } while (isalnum ((int) *cp) || *cp == '_' || *cp == '#' || *cp == ':' || *cp == '$'); vStringTerminate (name); makeSimpleTag (name, VimKinds, K_VARIABLE); vStringClear (name); }cleanUp: vStringDelete (name);}
开发者ID:Monits,项目名称:ctags,代码行数:58,
示例10: addContextstatic void addContext (tokenInfo* const parent, const tokenInfo* const child){ if (vStringLength (parent->string) > 0) { vStringCatS (parent->string, "."); } vStringCatS (parent->string, vStringValue(child->string)); vStringTerminate(parent->string);}
开发者ID:MihailZenkov,项目名称:geany,代码行数:9,
示例11: addToScopestatic void addToScope (tokenInfo* const token, vString* const extra){ if (vStringLength (token->scope) > 0) { vStringCatS (token->scope, "."); } vStringCatS (token->scope, vStringValue(extra)); vStringTerminate(token->scope);}
开发者ID:MihailZenkov,项目名称:geany,代码行数:9,
示例12: isIgnoreToken/* Determines whether or not "name" should be ignored, per the ignore list. */extern boolean isIgnoreToken (const char *const name, boolean *const pIgnoreParens, const char **const replacement){ boolean result = FALSE; if (c_tags_ignore != NULL) { const size_t nameLen = strlen (name); unsigned int i; guint len = g_strv_length (c_tags_ignore); vString *token = vStringNew(); if (pIgnoreParens != NULL) *pIgnoreParens = FALSE; for (i = 0 ; i < len ; ++i) { size_t tokenLen; vStringCopyS (token, c_tags_ignore[i]); vStringTerminate (token); tokenLen = vStringLength (token); if (tokenLen >= 2 && vStringChar (token, tokenLen - 1) == '*' && strncmp (vStringValue (token), name, tokenLen - 1) == 0) { result = TRUE; break; } if (strncmp (vStringValue (token), name, nameLen) == 0) { if (nameLen == tokenLen) { result = TRUE; break; } else if (tokenLen == nameLen + 1 && vStringChar (token, tokenLen - 1) == '+') { result = TRUE; if (pIgnoreParens != NULL) *pIgnoreParens = TRUE; break; } else if (vStringChar (token, nameLen) == '=') { if (replacement != NULL) *replacement = vStringValue (token) + nameLen + 1; break; } } } vStringDelete (token); } return result;}
开发者ID:15ramky,项目名称:geany,代码行数:59,
示例13: readIdentifier/* Algorithm adapted from from GNU etags. * Scheme tag functions * look for (def... xyzzy * look for (def... (xyzzy * look for (def ... ((... (xyzzy .... * look for (set! xyzzy */static void readIdentifier (vString *const name, const unsigned char *cp){ const unsigned char *p; vStringClear (name); /* Go till you get to white space or a syntactic break */ for (p = cp; *p != '/0' && *p != '(' && *p != ')' && !isspace (*p); p++) vStringPut (name, (int) *p); vStringTerminate (name);}
开发者ID:bogota,项目名称:ctags,代码行数:16,
示例14: add_tagstatic void add_tag(const char *token, haskellKind kind, vString *name){ int i; for (i = 0; token[i] != '/0'; ++i) vStringPut(name, token[i]); vStringTerminate(name); makeSimpleTag(name, HaskellKinds, kind); vStringClear(name);}
开发者ID:max630,项目名称:ctags,代码行数:10,
示例15: pushScopestatic void pushScope (tokenInfo *const token, const tokenInfo *const parent, const jsonKind parentKind){ if (vStringLength (token->scope) > 0) vStringPut (token->scope, '.'); vStringCat (token->scope, parent->string); vStringTerminate (token->scope); token->scopeKind = parentKind;}
开发者ID:FabianInostroza,项目名称:geany,代码行数:10,
示例16: while/* Match the name of a tag (function, variable, type, ...) starting at pos. */static char const *extract_name (char const *pos, vString * name){ while (isspace (*pos)) pos++; vStringClear (name); for (; *pos && !isspace (*pos) && *pos != '(' && *pos != ',' && *pos != '='; pos++) vStringPut (name, *pos); vStringTerminate (name); return pos;}
开发者ID:FabianInostroza,项目名称:geany,代码行数:11,
示例17: emitRubyTag/** Emits a tag for the given 'name' of kind 'kind' at the current nesting.*/static void emitRubyTag (vString* name, rubyKind kind){ tagEntryInfo tag; vString* scope; tagEntryInfo *parent; rubyKind parent_kind = K_UNDEFINED; NestingLevel *lvl; const char *unqualified_name; const char *qualified_name; int r; if (!RubyKinds[kind].enabled) { return; } vStringTerminate (name); scope = nestingLevelsToScope (nesting); lvl = nestingLevelsGetCurrent (nesting); parent = getEntryOfNestingLevel (lvl); if (parent) parent_kind = parent->kind - RubyKinds; qualified_name = vStringValue (name); unqualified_name = strrchr (qualified_name, SCOPE_SEPARATOR); if (unqualified_name && unqualified_name[1]) { if (unqualified_name > qualified_name) { if (vStringLength (scope) > 0) vStringPut (scope, SCOPE_SEPARATOR); vStringNCatS (scope, qualified_name, unqualified_name - qualified_name); /* assume module parent type for a lack of a better option */ parent_kind = K_MODULE; } unqualified_name++; } else unqualified_name = qualified_name; initTagEntry (&tag, unqualified_name, &(RubyKinds [kind])); if (vStringLength (scope) > 0) { Assert (0 <= parent_kind && (size_t) parent_kind < (ARRAY_SIZE (RubyKinds))); tag.extensionFields.scopeKind = &(RubyKinds [parent_kind]); tag.extensionFields.scopeName = vStringValue (scope); } r = makeTagEntry (&tag); nestingLevelsPush (nesting, r); vStringClear (name); vStringDelete (scope);}
开发者ID:amosbird,项目名称:ctags,代码行数:58,
示例18: readAndEmitTagstatic void readAndEmitTag (const unsigned char** cp, rubyKind expected_kind){ if (isspace (**cp)) { vString *name = vStringNew (); vString *chunk = vStringNew (); rubyKind actual_kind; unsigned int i = 0; /* parse the identifier, allowing scoping like "class Foo::Bar::Baz" */ while (1) { actual_kind = parseIdentifier (cp, chunk, expected_kind); if (i++ > 0) vStringPut (name, '.'); vStringCat (name, chunk); vStringClear (chunk); if (actual_kind != K_UNDEFINED && (*cp)[0] == ':' && (*cp)[1] == ':') *cp += 2; else break; } vStringDelete (chunk); vStringTerminate (name); if (actual_kind == K_UNDEFINED || vStringLength (name) == 0) { /* * What kind of tags should we create for code like this? * * %w(self.clfloor clfloor).each do |name| * module_eval <<-"end;" * def #{name}(x, y=1) * q, r = x.divmod(y) * q = q.to_i * return q, r * end * end; * end * * Or this? * * class << HTTP * * For now, we don't create any. */ } else { emitRubyTag (name, actual_kind); } vStringDelete (name); }}
开发者ID:pombredanne,项目名称:ctags.rb,代码行数:55,
示例19: parseSelectorstatic void parseSelector (vString *const string, const int firstChar){ int c = firstChar; do { vStringPut (string, (char) c); c = fileGetc (); } while (isSelectorChar (c)); fileUngetc (c); vStringTerminate (string);}
开发者ID:relaxdiego,项目名称:ctags,代码行数:11,
示例20: parseIdentifierstatic void parseIdentifier (vString *const string, const int firstChar){ int c = firstChar; do { vStringPut (string, c); c = getcFromInputFile (); } while (isIdentChar (c)); vStringTerminate (string); ungetcToInputFile (c); /* always unget, LF might add a semicolon */}
开发者ID:Dev0Null,项目名称:ctags,代码行数:11,
示例21: parseIdentifier/** Copies the characters forming an identifier from *cp into* name, leaving *cp pointing to the character after the identifier.*/static rubyKind parseIdentifier ( const unsigned char** cp, vString* name, rubyKind kind){ /* Method names are slightly different to class and variable names. * A method name may optionally end with a question mark, exclamation * point or equals sign. These are all part of the name. * A method name may also contain a period if it's a singleton method. */ const char* also_ok = (kind == K_METHOD) ? "_.?!=" : "_"; skipWhitespace (cp); /* Check for an anonymous (singleton) class such as "class << HTTP". */ if (kind == K_CLASS && **cp == '<' && *(*cp + 1) == '<') { return K_UNDEFINED; } /* Check for operators such as "def []=(key, val)". */ if (kind == K_METHOD || kind == K_SINGLETON) { if (parseRubyOperator (name, cp)) { return kind; } } /* Copy the identifier into 'name'. */ while (**cp != 0 && (isalnum (**cp) || charIsIn (**cp, also_ok))) { char last_char = **cp; vStringPut (name, last_char); ++*cp; if (kind == K_METHOD) { /* Recognize singleton methods. */ if (last_char == '.') { vStringTerminate (name); vStringClear (name); return parseIdentifier (cp, name, K_SINGLETON); } /* Recognize characters which mark the end of a method name. */ if (charIsIn (last_char, "?!=")) { break; } } } return kind;}
开发者ID:jsvisa,项目名称:ctags,代码行数:58,
示例22: initPhpEntrystatic void initPhpEntry (tagEntryInfo *const e, const tokenInfo *const token, const phpKind kind, const accessType access){ int parentKind = -1; const char *rootsep; vStringClear (FullScope); if (vStringLength (CurrentNamesapce) > 0) { parentKind = K_NAMESPACE; rootsep = scopeSeparatorFor (PhpKinds + parentKind, KIND_NULL); vStringCatS (FullScope, rootsep); vStringCat (FullScope, CurrentNamesapce); } initTagEntry (e, vStringValue (token->string), &(PhpKinds[kind])); e->lineNumber = token->lineNumber; e->filePosition = token->filePosition; if (access != ACCESS_UNDEFINED) e->extensionFields.access = accessToString (access); if (vStringLength (token->scope) > 0) { parentKind = token->parentKind; if (vStringLength (FullScope) > 0) { const char* sep; sep = phpScopeSeparatorFor (parentKind, K_NAMESPACE); vStringCatS (FullScope, sep); } else { rootsep = scopeSeparatorFor (PhpKinds + parentKind, KIND_NULL); vStringCatS (FullScope, rootsep); } vStringCat (FullScope, token->scope); } if (vStringLength (FullScope) > 0) { Assert (parentKind >= 0); vStringTerminate (FullScope); e->extensionFields.scopeKind = &(PhpKinds[parentKind]); e->extensionFields.scopeName = vStringValue (FullScope); }}
开发者ID:blackb1rd,项目名称:ctags,代码行数:54,
示例23: parseFunctionstatic void parseFunction (const unsigned char *line){ vString *name = vStringNew (); /* boolean inFunction = FALSE; */ int scope; const unsigned char *cp = line + 1; if ((int) *++cp == 'n' && (int) *++cp == 'c' && (int) *++cp == 't' && (int) *++cp == 'i' && (int) *++cp == 'o' && (int) *++cp == 'n') ++cp; if ((int) *cp == '!') ++cp; if (isspace ((int) *cp)) { while (*cp && isspace ((int) *cp)) ++cp; if (*cp) { cp = skipPrefix (cp, &scope); if (isupper ((int) *cp) || scope == 's' || /* script scope */ scope == '<' || /* script scope */ scope == 'd' || /* dictionary */ scope == 'a') /* autoload */ { do { vStringPut (name, (int) *cp); ++cp; } while (isalnum ((int) *cp) || *cp == '_' || *cp == '.' || *cp == '#'); vStringTerminate (name); makeSimpleTag (name, VimKinds, K_FUNCTION); vStringClear (name); } } } /* TODO - update struct to indicate inside function */ while ((line = readVimLine ()) != NULL) { /* * Vim7 added the for/endfo[r] construct, so we must first * check for an "endfo", before a "endf" */ if ( (!strncmp ((const char*) line, "endfo", (size_t) 5) == 0) && (strncmp ((const char*) line, "endf", (size_t) 4) == 0) ) break; /* TODO - call parseVimLine */ } vStringDelete (name);}
开发者ID:Cognoscan,项目名称:ctags,代码行数:54,
示例24: parseIdentifierstatic void parseIdentifier (vString *const string, const int firstChar){ int c = firstChar; do { vStringPut (string, (char) c); c = getcFromInputFile (); } while (isIdentChar (c)); ungetcToInputFile (c); vStringTerminate (string);}
开发者ID:blackb1rd,项目名称:ctags,代码行数:11,
示例25: readIdentifierstatic void readIdentifier (const int first, vString *const id){ int c = first; vStringClear (id); while (isIdentifier (c)) { vStringPut (id, c); c = nextChar (); } fileUngetc (c); vStringTerminate (id);}
开发者ID:ajitvin,项目名称:v,代码行数:12,
示例26: parseIdentifier/* Read a C identifier beginning with "firstChar" and places it into * "name". */static void parseIdentifier (vString *const string, const int firstChar){ int c = firstChar; Assert (isIdentChar (c)); do { vStringPut (string, c); c = fileGetc (); } while (isIdentChar (c)); vStringTerminate (string); fileUngetc (c); /* unget non-identifier character */}
开发者ID:BenWiederhake,项目名称:geany,代码行数:15,
示例27: vStringClearstatic const unsigned char *parseIdentifier ( const unsigned char *cp, vString *const identifier){ vStringClear (identifier); while (isIdentifierCharacter ((int) *cp)) { vStringPut (identifier, (int) *cp); ++cp; } vStringTerminate (identifier); return cp;}
开发者ID:simlrh,项目名称:ctags,代码行数:12,
示例28: determineEmacsModeAtFirstLinestatic vString* determineEmacsModeAtFirstLine (const char* const line){ vString* mode = vStringNew (); const char* p = strstr(line, "-*-"); if (p == NULL) return mode; p += strlen("-*-"); for ( ; isspace ((int) *p) ; ++p) ; /* no-op */ if (strncmp(p, "mode:", strlen("mode:")) == 0) { /* -*- mode: MODE; -*- */ p += strlen("mode:"); for ( ; isspace ((int) *p) ; ++p) ; /* no-op */ for ( ; *p != '/0' && isalnum ((int) *p) ; ++p) vStringPut (mode, (int) *p); vStringTerminate (mode); } else { /* -*- MODE -*- */ for ( ; *p != '/0' && isalnum ((int) *p) ; ++p) vStringPut (mode, (int) *p); vStringTerminate (mode); for ( ; isspace ((int) *p) ; ++p) ; /* no-op */ if (strncmp(p, "-*-", strlen("-*-")) != 0) vStringClear (mode); } return mode;}
开发者ID:heilage-nsk,项目名称:configs,代码行数:38,
示例29: addToScopestatic void addToScope (tokenInfo *const token, const vString *const extra, int kindOfUpperScope){ if (vStringLength (token->scope) > 0) { const char* sep; sep = phpScopeSeparatorFor(token->parentKind, kindOfUpperScope); vStringCatS (token->scope, sep); } vStringCat (token->scope, extra); vStringTerminate(token->scope);}
开发者ID:blackb1rd,项目名称:ctags,代码行数:14,
注:本文中的vStringTerminate函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ vStringValue函数代码示例 C++ vStringPut函数代码示例 |