这篇教程C++ GetVar函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetVar函数的典型用法代码示例。如果您正苦于以下问题:C++ GetVar函数的具体用法?C++ GetVar怎么用?C++ GetVar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetVar函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: IDriveCloseFileWriteint IDriveCloseFileWrite(TFileStore *FS, STREAM *S){ char *Tempstr=NULL, *Error=NULL, *ptr; ListNode *Vars=NULL; HTTPInfoStruct *Info; int result=FALSE, val; Info=(HTTPInfoStruct *) FS->Extra; if (Info) { Tempstr=MCopyStr(Tempstr,"/r/n--",STREAMGetValue(S,"Boundary"),"--/r/n",NULL); STREAMWriteLine(Tempstr,S); STREAMFlush(S); HTTPTransact(Info); /*<?xml version="1.0" encoding="UTF-8"?><tree message="SUCCESS"> <item filename="autoget.c" filesize="27620" lmd="1969/12/31 16:00:00" message="SUCCESS"/></tree>*/ val=HTTPReadDocument(S, &Tempstr); if (Settings.Flags & FLAG_VERBOSE) printf("/n%s/n",Tempstr); Vars=ListCreate(); IDriveParseResponse(Tempstr, Vars); Tempstr=CopyStr(Tempstr,GetVar(Vars,"message")); if (strcmp(Tempstr,"SUCCESS")==0) { val=atoi(STREAMGetValue(S,"Transfer-Size")); if (val==atoi(GetVar(Vars,"filesize"))) result=TRUE; else result=ERR_INTERRUPTED; } else { SetVar(FS->Vars,"Error",GetVar(Vars,"desc")); result=ERR_CUSTOM; } }DestroyString(Tempstr);return(result);}
开发者ID:ColumPaget,项目名称:FileFerry,代码行数:49,
示例2: OAuthRefreshint OAuthRefresh(OAUTH *Ctx, const char *URL){ char *Tempstr=NULL, *Args=NULL; const char *ptr; int result; /* POST, GET client_id (integer) : Your app's client_id (obtained during app registration) client_id and client_secrect can be provided via HTTP Basic Authentication see http://tools.ietf.org/html/rfc6750#section-2.1 POST, GET client_secret (string) : Your app's client_secret (obtained during app registration) client_id and client_secrect can be provided via HTTP Basic Authentication see http://tools.ietf.org/html/rfc6750#section-2.1 POST, GET grant_type (string) : The value must be refresh_token POST, GET refresh_token (string) : required */ ptr=GetVar(Ctx->Vars, "client_id"); if (StrValid(ptr)) { Tempstr=HTTPQuote(Tempstr, ptr); Args=MCopyStr(Args,"client_id=",Tempstr,NULL); } ptr=GetVar(Ctx->Vars, "client_secret"); if (StrValid(ptr)) { Tempstr=HTTPQuote(Tempstr, ptr); Args=MCatStr(Args,"&client_secret=",Tempstr,NULL); } if (StrValid(Ctx->RefreshToken)) { Tempstr=HTTPQuote(Tempstr, Ctx->RefreshToken); Args=MCatStr(Args,"&refresh_token=",Tempstr,NULL); } Args=MCatStr(Args,"&grant_type=refresh_token",NULL); result=OAuthGrant(Ctx, URL, Args); DestroyString(Tempstr); DestroyString(Args); return(result);}
开发者ID:ColumPaget,项目名称:Crayonizer,代码行数:48,
示例3: IDriveLoadDirint IDriveLoadDir(TFileStore *FS, char *InPattern, ListNode *Items, int Flags){int result;char *Tempstr=NULL, *XML=NULL;char *TagName=NULL, *TagData=NULL, *ptr;TFileInfo *FI;HTTPInfoStruct *Info;ListNode *Vars; Tempstr=MCopyStr(Tempstr,"https://",FS->Host,"/evs/browseFolder?uid=",FS->Logon,"&pwd=",FS->Passwd,"&p=",FS->CurrDir,NULL); FS->S=HTTPMethod("POST",Tempstr,"","","","",0); Tempstr=STREAMReadDocument(Tempstr, FS->S, TRUE); ptr=XMLGetTag(Tempstr,NULL,&TagName,&TagData); while (ptr) { if (strcmp(TagName,"item")==0) { FI=IDriveReadFileEntry(TagData); if (Items) ListAddNamedItem(Items,FI->Name,FI); } ptr=XMLGetTag(ptr,NULL,&TagName,&TagData); }STREAMClose(FS->S);FS->S=NULL;Tempstr=MCopyStr(Tempstr,"https://",FS->Host,"/evs/getAccountQuota?uid=",FS->Logon,"&pwd=",FS->Passwd,NULL);FS->S=HTTPMethod("POST",Tempstr,"","","","",0);Tempstr=STREAMReadDocument(Tempstr, FS->S, TRUE);Vars=ListCreate();IDriveParseResponse(Tempstr,Vars);FS->BytesAvailable=strtod(GetVar(Vars,"totalquota"),NULL);FS->BytesUsed=strtod(GetVar(Vars,"usedquota"),NULL);ListDestroy(Vars,DestroyString);DestroyString(TagName);DestroyString(TagData);DestroyString(Tempstr);DestroyString(XML);return(TRUE);}
开发者ID:ColumPaget,项目名称:FileFerry,代码行数:48,
示例4: GetVarConfVarString* ConfVarTable::GetStr(const string_t &name, const string_t &def){ std::pair<ConfVar*, bool> p = GetVar(name, ConfVar::typeString); if( !p.second ) p.first->AsStr()->Set(def); return p.first->AsStr();}
开发者ID:ACefalu,项目名称:tzod,代码行数:7,
示例5: GetNsisString// Based on Dave Laundon's simplified process_stringAString GetNsisString(const AString &s){ AString res; for (int i = 0; i < s.Length();) { unsigned char nVarIdx = s[i++]; if (nVarIdx > NS_CODES_START && i + 2 <= s.Length()) { int nData = s[i++] & 0x7F; unsigned char c1 = s[i++]; nData |= (((int)(c1 & 0x7F)) << 7); if (nVarIdx == NS_SHELL_CODE) res += GetShellString(c1); else if (nVarIdx == NS_VAR_CODE) res += GetVar(nData); else if (nVarIdx == NS_LANG_CODE) res += "NS_LANG_CODE"; } else if (nVarIdx == NS_SKIP_CODE) { if (i < s.Length()) res += s[i++]; } else // Normal char res += (char)nVarIdx; } return res;}
开发者ID:Dabil,项目名称:puNES,代码行数:30,
示例6: FileStoreGetFileTypeSTREAM *InternalCopyOpenDest(TTransferContext *Ctx, TFileInfo *SrcFI, TFileInfo *DestFI){STREAM *S;char *ptr;int val=0; //For the destination we are writing the file into the current directory, so never use a full path //use the name of the source file as the path if (Ctx->CmdFlags & FLAG_CMD_EXTN_TEMP) DestFI->Path=PathChangeExtn(DestFI->Path, SrcFI->Name, GetVar(Ctx->Vars,"TransferTempExtn")); else DestFI->Path=CopyStr(DestFI->Path, SrcFI->Name); DestFI->Permissions=CopyStr(DestFI->Permissions,TransferDecidePermissions(SrcFI)); ptr=GetVar(Ctx->Vars,"ContentType"); if (StrLen(ptr)) DestFI->MediaType=CopyStr(DestFI->MediaType,ptr); else FileStoreGetFileType(Ctx->SrcFS, DestFI); val=OPEN_WRITE; if (Ctx->CmdFlags & FLAG_CMD_PUBLIC) val |= OPEN_PUBLIC; if ( (Ctx->CmdFlags & FLAG_CMD_RESUME) && (Ctx->SrcFS->Features & FS_RESUME_TRANSFERS) && (Ctx->DestFS->Features & FS_RESUME_TRANSFERS) ) val |= OPEN_RESUME; S=Ctx->DestFS->OpenFile(Ctx->DestFS,DestFI, val);return(S);}
开发者ID:zhangjinde,项目名称:FileFerry,代码行数:28,
示例7: font_read_settings// Read settingsvoid font_read_settings(font_data *data){ char buf[80],*ptr; struct IBox dims; // Get environment variable if (GetVar("dopus/Font Viewer",buf,sizeof(buf),GVF_GLOBAL_ONLY)<=0) return; // Get pointer to buffer ptr=buf; // Parse settings read_parse_set(&ptr,(UWORD *)&dims.Left); read_parse_set(&ptr,(UWORD *)&dims.Top); read_parse_set(&ptr,(UWORD *)&dims.Width); read_parse_set(&ptr,(UWORD *)&dims.Height); // Got valid size? if (dims.Height>0) { // Clear character coordinates data->win_dims.char_dim.Top=0; data->win_dims.char_dim.Left=0; data->win_dims.char_dim.Width=0; data->win_dims.char_dim.Height=0; // Set absolute coordinates data->win_dims.fine_dim=dims; }}
开发者ID:timofonic,项目名称:dopus5allamigas,代码行数:32,
示例8: EncontrarCant/* ' @remarks This function reads the Npc.dat file */int EncontrarCant(int NpcIndex, int ObjIndex) { int retval; /* '*************************************************** */ /* 'Author: Unknown */ /* 'Last Modification: 03/09/08 */ /* 'Last Modification By: Marco Vanotti (Marco) */ /* ' - 03/09/08 EncontrarCant now returns 0 if the npc doesn't have it (Marco) */ /* '*************************************************** */ /* 'Devuelve la cantidad original del obj de un npc */ std::string ln; std::string npcfile; int i; npcfile = GetDatPath(DATPATH::NPCs); for (i = (1); i <= (MAX_INVENTORY_SLOTS); i++) { ln = GetVar(npcfile, "NPC" + vb6::CStr(Npclist[NpcIndex].Numero), "Obj" + vb6::CStr(i)); if (ObjIndex == vb6::val(ReadField(1, ln, 45))) { retval = (int) vb6::val(ReadField(2, ln, 45)); return retval; } } retval = 0; return retval;}
开发者ID:Chaitooler,项目名称:dakara-server,代码行数:30,
示例9: GetVarvoid clConsole::ExecuteBinding( const int Key, const bool KeyState ){ if ( !FKeyBindings[Key].empty() ) { if ( LStr::IsFirstChar( FKeyBindings[Key], '+' ) ) { // The "+" command is processed separatly and doesn't need to be registred LString VarName = FKeyBindings[Key].substr( 1, FKeyBindings[Key].length() - 1 ); clCVar* CVar = GetVar( VarName ); CVar->SetBool( KeyState ); } else { if ( KeyState ) { SendCommand( FKeyBindings[Key] ); } } } // autorelease mouse wheel if ( ( Key == LK_WHEELUP || Key == LK_WHEELDOWN ) && ( KeyState ) ) { ExecuteBinding( Key, false ); }}
开发者ID:berezhkovskaya,项目名称:Carousel3D,代码行数:27,
示例10: SetupDefaultMethodOne<Builder> MakeBuild::CreateBuilder(Host *host){ SetupDefaultMethod(); VectorMap<String, String> bm = GetMethodVars(method); String builder = bm.Get("BUILDER", "GCC"); int q = BuilderMap().Find(builder); if(q < 0) { PutConsole("Invalid builder " + builder); ConsoleShow(); return NULL; } One<Builder> b = (*BuilderMap().Get(builder))(); b->host = host; b->compiler = bm.Get("COMPILER", ""); b->include = SplitDirs(GetVar("UPP") + ';' + bm.Get("INCLUDE", "") + ';' + add_includes); const Workspace& wspc = GetIdeWorkspace(); for(int i = 0; i < wspc.GetCount(); i++) { const Package& pkg = wspc.GetPackage(i); for(int j = 0; j < pkg.include.GetCount(); j++) b->include.Add(SourcePath(wspc[i], pkg.include[j].text)); } b->libpath = SplitDirs(bm.Get("LIB", "")); b->debug_options = bm.Get("DEBUG_OPTIONS", ""); b->release_options = bm.Get("RELEASE_OPTIONS", ""); b->release_size_options = bm.Get("RELEASE_SIZE_OPTIONS", ""); b->debug_link = bm.Get("DEBUG_LINK", ""); b->release_link = bm.Get("RELEASE_LINK", ""); b->script = bm.Get("SCRIPT", ""); b->main_conf = !!main_conf.GetCount(); return b;}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:31,
示例11: LocalHostString MakeBuild::OutDir(const Index<String>& cfg, const String& package, const VectorMap<String, String>& bm, bool use_target){ Index<String> excl; excl.Add(bm.Get("BUILDER", "GCC")); excl.Add("MSC"); LocalHost().AddFlags(excl); Vector<String> x; bool dbg = cfg.Find("DEBUG_FULL") >= 0 || cfg.Find("DEBUG_MINIMAL") >= 0; if(cfg.Find("DEBUG") >= 0) { excl.Add("BLITZ"); if(cfg.Find("BLITZ") < 0) x.Add("NOBLITZ"); } else if(dbg) x.Add("RELEASE"); if(use_target) excl.Add("MAIN"); for(int i = 0; i < cfg.GetCount(); i++) if(excl.Find(cfg[i]) < 0) x.Add(cfg[i]); Sort(x); for(int i = 0; i < x.GetCount(); i++) x[i] = InitCaps(x[i]); String outdir = GetVar("OUTPUT"); if(output_per_assembly) outdir = AppendFileName(outdir, GetVarsName()); if(!use_target) outdir = AppendFileName(outdir, package); outdir = AppendFileName(outdir, GetFileTitle(method) + "." + Join(x, ".")); outdir = Filter(outdir, CharFilterSlash); return outdir;}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:34,
示例12: DoCommand void DoCommand(const std::string& newline, User* user, Channel *chan, const std::string &original_line) { std::string result; result.reserve(newline.length()); for (unsigned int i = 0; i < newline.length(); i++) { char c = newline[i]; if ((c == '$') && (i + 1 < newline.length())) { if (isdigit(newline[i+1])) { int len = ((i + 2 < newline.length()) && (newline[i+2] == '-')) ? 3 : 2; std::string var = newline.substr(i, len); result.append(GetVar(var, original_line)); i += len - 1; } else if (newline.substr(i, 5) == "$nick") { result.append(user->nick); i += 4; } else if (newline.substr(i, 5) == "$host") { result.append(user->host); i += 4; } else if (newline.substr(i, 5) == "$chan") { if (chan) result.append(chan->name); i += 4; } else if (newline.substr(i, 6) == "$ident") { result.append(user->ident); i += 5; } else if (newline.substr(i, 6) == "$vhost") { result.append(user->dhost); i += 5; } else result.push_back(c); } else result.push_back(c); } irc::tokenstream ss(result); std::vector<std::string> pars; std::string command, token; ss.GetToken(command); while (ss.GetToken(token)) { pars.push_back(token); } ServerInstance->Parser->CallHandler(command, pars, user); }
开发者ID:GeeksIRC,项目名称:inspircd,代码行数:60,
示例13: SaveIfNeeded// SaveIfNeededvoid SavedVariableBank::SaveIfNeeded() { // Basically, force save if the player collected a star if(GM_STAR_COUNT > GetVar(SPECIAL_SAVE_STR)) { SetVar(SPECIAL_SAVE_STR, GM_STAR_COUNT); WriteBank(); }}
开发者ID:ifzz,项目名称:LunaDLL,代码行数:8,
示例14: test_serectchar* test_serect(){ loadtable(); SetVar(test,100); GetVar(outputpool,100); return outputpool;}
开发者ID:satanupup,项目名称:epb,代码行数:7,
示例15: voidConfVarArray* ConfVarTable::GetArray(const string_t &name, void (*init)(ConfVarArray*)){ std::pair<ConfVar*, bool> p = GetVar(name, ConfVar::typeArray); if( !p.second && init ) init(p.first->AsArray()); return p.first->AsArray();}
开发者ID:ACefalu,项目名称:tzod,代码行数:7,
示例16: GetVarPVideoFrame __stdcall Write::GetFrame(int n, IScriptEnvironment* env) {//changed to call write AFTER the child->GetFrame PVideoFrame tmpframe = child->GetFrame(n, env); if (linecheck<0) return tmpframe; //do nothing here when writing only start or end AVSValue prev_last = env->GetVar("last"); // Store previous last AVSValue prev_current_frame = GetVar(env, "current_frame"); // Store previous current_frame env->SetVar("last",(AVSValue)child); // Set implicit last (to avoid recursive stack calls?) env->SetVar("current_frame",n); if (Write::DoEval(env)) { Write::FileOut(env); } env->SetVar("last",prev_last); // Restore implicit last env->SetVar("current_frame",prev_current_frame); // Restore current_frame return tmpframe;};
开发者ID:GDXN,项目名称:avxsynth,代码行数:25,
示例17: returnchar *LibUsefulGetValue(char *Name){if (! LibUsefulSettings) LibUsefulInitSettings();if (!StrLen(Name)) return("");return(GetVar(LibUsefulSettings,Name));}
开发者ID:ColumPaget,项目名称:Alaya,代码行数:7,
示例18: DiaProductsRetrievestaticvoidDiaProductsRetrieve(t_dia_req *preq, t_dia_rspparam *par, ...){ DIA_LOCAL_VAR(); (void)updatecont; (void)updateelem; (void)tmp; (void)parseflags; sprintf(target,"%s%s/%s/containers/products/contentInstances/%s/content", GetHostTarget(), SCL_ROOT_APP, GetVar("w_ipuid"), ProductsGetRefFromId(preq->rq_dev)); if (par == NULL) { // REQUESTretry: DIA_RETRIEVE_REQUEST(DiaProductsRetrieve); return; } // RESPONSE DIA_RETRIEVE_RESPONSE(DiaProductsError,DiaProductsError,DiaProductsOk);}
开发者ID:actility,项目名称:ong,代码行数:27,
示例19: OAuthSaveint OAuthSave(OAUTH *Ctx, const char *Path){ STREAM *S; const char *Fields[]= {"client_id","client_secret","access_token","refresh_token",NULL}; const char *ptr; char *Tempstr=NULL; int i; if (! StrValid(Path)) { if (! StrValid(Ctx->SavePath)) return(FALSE); S=STREAMOpen(Ctx->SavePath,"aEL"); } else S=STREAMOpen(Path,"aEL"); if (S) { Tempstr=MCopyStr(Tempstr, "'", Ctx->Name,"' ",NULL); for (i=0; Fields[i] !=NULL; i++) { ptr=GetVar(Ctx->Vars,Fields[i]); if (StrValid(ptr)) Tempstr=MCatStr(Tempstr, Fields[i], "='", ptr, "' ",NULL); } Tempstr=CatStr(Tempstr,"/n"); STREAMWriteLine(Tempstr, S); STREAMClose(S); } DestroyString(Tempstr); return(TRUE);}
开发者ID:ColumPaget,项目名称:Crayonizer,代码行数:32,
示例20: ifSTREAM *InternalCopyOpenSource(TTransferContext *Ctx, TFileInfo *SrcFI){STREAM *S;char *ptr;int val=0;//Specify the DESTINATION size in the source, for use in 'resume' transfersif (Ctx->DestFS->GetFileSize) SrcFI->ResumePoint=Ctx->DestFS->GetFileSize(Ctx->DestFS, SrcFI->Name);//Set version info if getting a particular version of fileptr=GetVar(Ctx->Vars,"Version");SetVar(SrcFI->Vars,"Version,",ptr);if ( (Ctx->CmdFlags & FLAG_CMD_RESUME) && (Ctx->SrcFS->Features & FS_RESUME_TRANSFERS) && (Ctx->DestFS->Features & FS_RESUME_TRANSFERS) ) val |= OPEN_RESUME;S=Ctx->SrcFS->OpenFile(Ctx->SrcFS,SrcFI, val);//OPEN SOURCE DONE//Construct 'write' args. THESE ARE ARGS TO OPEN THE DEST FILEif (S){ ptr=STREAMGetValue(S,"filesize"); if (StrLen(ptr)) SrcFI->Size=atoi(ptr); else if (Ctx->SrcFS->GetFileSize) SrcFI->Size=Ctx->SrcFS->GetFileSize(Ctx->SrcFS, SrcFI->Path);}return(S);}
开发者ID:zhangjinde,项目名称:FileFerry,代码行数:33,
示例21: ProcessCreateFile//This accepts a single pattern to match against. If that includes a space, it is thought to be a filename//with a space in. To supply multiple patterns look at "ProcessPutFiles" below.int ProcessCreateFile(TFileStore *FS, char *Name, ListNode *Vars){TFileInfo *FI;int result;char *ptr;STREAM *S;TTransferContext *Ctx;FI=FileInfoCreate(Name, Name, FTYPE_FILE, 0, 0);ptr=GetVar(Vars,"ContentType");if (StrLen(ptr)) FI->MediaType=CopyStr(FI->MediaType,ptr);else FileStoreGetFileType(FS, FI);S=FS->OpenFile(FS, FI, OPEN_WRITE);result=FS->CloseFile(FS,S);if (result != TRANSFER_OKAY) { Ctx=TransferContextCreate(NULL, FS, 0, 0, Vars); HandleTransferResult(Ctx,FI, result); TransferContextDestroy(Ctx);}FileInfoDestroy(FI);return(result);}
开发者ID:zhangjinde,项目名称:FileFerry,代码行数:28,
示例22: DefineVarCFXCrossFade::CFXCrossFade(){ DefineVar("Alpha", CVarFloat::CLASSNAME); DefineVar("Blend Mode", CVarCombo::CLASSNAME); // Add combo options ((CVarCombo*)GetVar("Blend Mode"))->AddOption("Mult"); ((CVarCombo*)GetVar("Blend Mode"))->AddOption("Add"); // Set default alpha value. // The desired one would have been a linear change from 0.0 to 1.0 but since we don't // know the effect time range at this point yet, we can't do that. ((CVarFloat*)GetVar("Alpha"))->SetConstant(0.5f);}
开发者ID:fernandojsg,项目名称:sgzsourcepack,代码行数:16,
注:本文中的GetVar函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetVector函数代码示例 C++ GetValueInternal函数代码示例 |