• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetVar函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetVar函数的典型用法代码示例。如果您正苦于以下问题:C++ GetVar函数的具体用法?C++ GetVar怎么用?C++ GetVar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetVar函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: IDriveCloseFileWrite

int 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,代码来源:idrive.c


示例2: OAuthRefresh

int 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,代码来源:OAuth.c


示例3: IDriveLoadDir

int 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,代码来源:idrive.c


示例4: GetVar

ConfVarString* 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,代码来源:ConfigBase.cpp


示例5: GetNsisString

// Based on Dave Laundon's simplified process_string
AString 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,代码来源:NsisIn.cpp


示例6: FileStoreGetFileType

STREAM *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,代码来源:commands-file-transfer.c


示例7: font_read_settings

// Read settings
void 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,代码来源:font.c


示例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,代码来源:InvNpcs.cpp


示例9: GetVar

void 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,代码来源:Console.cpp


示例10: SetupDefaultMethod

One<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,代码来源:Build.cpp


示例11: LocalHost

String 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,代码来源:Build.cpp


示例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,代码来源:m_alias.cpp


示例13: SaveIfNeeded

// SaveIfNeeded
void 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,代码来源:UserSaving.cpp


示例14: test_serect

char* test_serect()
{
	loadtable();
	SetVar(test,100);
	GetVar(outputpool,100);
	return outputpool;
}
开发者ID:satanupup,项目名称:epb,代码行数:7,代码来源:加密器.cpp


示例15: void

ConfVarArray* 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,代码来源:ConfigBase.cpp


示例16: GetVar

PVideoFrame __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,代码来源:conditional_reader.cpp


示例17: return

char *LibUsefulGetValue(char *Name)
{
if (! LibUsefulSettings) LibUsefulInitSettings();

if (!StrLen(Name)) return("");
return(GetVar(LibUsefulSettings,Name));
}
开发者ID:ColumPaget,项目名称:Alaya,代码行数:7,代码来源:libsettings.c


示例18: DiaProductsRetrieve

static
void
DiaProductsRetrieve(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) {
    // REQUEST
retry:
    DIA_RETRIEVE_REQUEST(DiaProductsRetrieve);
    return;
  }
  
  // RESPONSE
  DIA_RETRIEVE_RESPONSE(DiaProductsError,DiaProductsError,DiaProductsOk);
}
开发者ID:actility,项目名称:ong,代码行数:27,代码来源:diaproducts.c


示例19: OAuthSave

int 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,代码来源:OAuth.c


示例20: if

STREAM *InternalCopyOpenSource(TTransferContext *Ctx, TFileInfo *SrcFI)
{
STREAM *S;
char *ptr;
int val=0;

//Specify the DESTINATION size in the source, for use in 'resume' transfers
if (Ctx->DestFS->GetFileSize) SrcFI->ResumePoint=Ctx->DestFS->GetFileSize(Ctx->DestFS, SrcFI->Name);

//Set version info if getting a particular version of file
ptr=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 FILE

if (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,代码来源:commands-file-transfer.c



注:本文中的GetVar函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetVector函数代码示例发布时间:2022-05-30
下一篇:
C++ GetValueInternal函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap