当前位置: 首页>>代码示例>>C++>>正文


C++ Escape函数代码示例

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


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

示例1: scheme

FUUri::FUUri(const fstring& uri, bool escape)
	:	scheme(FUUri::NONE),
		port(0),
		path(FC(""))
{
	if (uri.empty()) return;

	fstring _uri;

	if (escape)
	{
		_uri = Escape(uri);
	}
	else
	{
		_uri = uri;
	}

	// Replace all '\\' characters by '/' so the path is only using them
	_uri.replace(FC('\\'), FC('/'));

	// Find the scheme from its ':' delimiter
	size_t schemeDelimiterIndex = _uri.find(FC(':'));
	size_t hostIndex = 0;

	if (schemeDelimiterIndex != fstring::npos && schemeDelimiterIndex > 1)
	{
		fstring _scheme = _uri.substr(0, schemeDelimiterIndex);

		if (IsEquivalent(_scheme, FC("FILE")) || IsEquivalent(_scheme, FC("file")))
		{
			scheme = FUUri::FILE;
		}
		else if (IsEquivalent(_scheme, FC("FTP")) || IsEquivalent(_scheme, FC("ftp")))
		{
			scheme = FUUri::FTP;
		}
		else if (IsEquivalent(_scheme, FC("HTTP")) || IsEquivalent(_scheme, FC("http")))
		{
			scheme = FUUri::HTTP;
		}
		else if (IsEquivalent(_scheme, FC("HTTPS")) || IsEquivalent(_scheme, FC("https")))
		{
			scheme = FUUri::HTTPS;
		}
		else
		{
#ifdef WIN32
			// Scheme not supported (could be a NFS path)
			FUFail(return);
#endif // WIN32
		}

		schemeDelimiter = _uri.substr(schemeDelimiterIndex, 3);
		hostIndex = schemeDelimiterIndex + 3;
	}
开发者ID:jb55,项目名称:jgblue,代码行数:56,代码来源:FUUri.cpp

示例2: l_plugin_call

int l_plugin_call(lua_State *L)
{
  char *plugin = (char *) luaL_checkstring(L, 1);
  char *command = (char *) luaL_checkstring(L, 2);
  char *params = (char *) luaL_checkstring(L, 3);

  int escaped_count = Escape(NULL, params, '\\');
  if (escaped_count)
  {
    char *escaped_params = new char[ lstrlen(params) + escaped_count + 1];
    Escape(escaped_params, params, '\\');

    siFuncs->DoCommand(plugin, command, escaped_params);
    delete escaped_params;
  }
  else
    siFuncs->DoCommand(plugin, command, params);

  return 0; // number of return values
}
开发者ID:LosEcher,项目名称:si_plugins,代码行数:20,代码来源:Scripting.cpp

示例3: assert

 // First result as string
 bool CArgMap::Get ( const SString& strCmd, SString& strOut, const char* szDefault ) const
 {
     assert ( szDefault );
     if ( const SString* pResult = MapFind ( m_Map, Escape ( strCmd ) ) )
     {
         strOut = Unescape ( *pResult );
         return true;
     }
     strOut = szDefault;
     return false;
 }
开发者ID:0x688,项目名称:gtasa_crashfix,代码行数:12,代码来源:SharedUtil.Misc.hpp

示例4: ToMathematica

std::string ToMathematica(Quantity<D> const& quantity) {
  std::string s = DebugString(quantity);
  if (IsFinite(quantity)) {
    s.replace(s.find("e"), 1, "*^");
  }
  std::string const number = ToMathematica(quantity / SIUnit<Quantity<D>>());
  std::size_t const split = s.find(" ");
  std::string const units = Escape(s.substr(split, s.size()));
  return Apply(
      "SetPrecision",
      {Apply("Quantity", {number, units}), "MachinePrecision"});
}
开发者ID:mkalte666,项目名称:Principia,代码行数:12,代码来源:mathematica_body.hpp

示例5: Main

void Main()
{
	String code = LoadFile("E:\\sic.sic");
	ArrayMap<String, SVal> global;

	Escape(global, "print(x)", SIC_Print);
	Escape(global, "dump_locals()", SIC_DumpLocals);

	StdLib(global);

	try {
		Scan(global, code);
		TimeStop();
		SVal ret = Execute(global, "main");
		RLOG(TimeStop());
		RLOG("RETURN VALUE: " << ret.Dump());
	}
	catch(CParser::Error& e)
	{
		RLOG(e);
	}
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:22,代码来源:main.cpp

示例6: QString

QByteArray Oauth::HmacSha1(QString secretKey, QString data, QString tokenSecret)
{
    QString signingKey = QString("%1&%2").arg(Escape(secretKey),Escape(tokenSecret));

    unsigned char result[EVP_MAX_MD_SIZE];
    unsigned int resultlen = 0;
    HMAC(
         EVP_sha1(),
         qPrintable(signingKey),
         signingKey.toLocal8Bit().length(),
         (unsigned char*)data.toLocal8Bit().data(),
         data.toLocal8Bit().length(),
         result,
         &resultlen
         );
    char* cbase64 = base64(result,resultlen);
    QByteArray resultArray(cbase64);
    qDebug() << resultArray;
    resultArray = resultArray.toPercentEncoding();
    free(cbase64);
    return resultArray;
}
开发者ID:smandava,项目名称:cuteflix,代码行数:22,代码来源:oauth.cpp

示例7: TPoint

//取得纸张的物理尺寸---单位:点
TPoint __fastcall CPrinter::GetPhicalPaper()
{
    if (PPRN == NULL)
    {
        return TPoint(-1, -1);
    }

    TPoint PageSize;
    //PageSize.X; 纸张物理宽度-单位:点
    //PageSize.Y; 纸张物理高度-单位:点
    Escape(PPRN->Handle, GETPHYSPAGESIZE, 0, NULL, &PageSize);
    return PageSize;
}
开发者ID:vagabond1132,项目名称:Code,代码行数:14,代码来源:uPrinter.cpp

示例8: LayoutOnEscape

static void LayoutOnEscape ()
	{ if (try_and_replace_rule (layout_rule, layout_dir))
	     { XtPopdown (layout_popup);
	       Escape ();
	     }
	  else
	     { StartArgs;
	       SetArg (XtNlabel, tuple_error_buffer);
	       XtSetValues (layout_error, UseArgs);
	       StartArgs;
	       SetArg (XtNeditable, True);
	       XtSetValues (layout_edit, UseArgs);
	     };
	};
开发者ID:tjordanchat,项目名称:eag,代码行数:14,代码来源:edt_editmain.c

示例9: Escape

string MXMLHandler::GetNodeWithTag(const string& xml, string name)
{
	Escape(name);
	string::size_type begin = xml.find("<"+name+">");
	if (begin == string::npos)
		return "";

	string::size_type end = xml.find("</"+name+">", begin);
	if (end == string::npos)
		return "";

	end += name.length() + 3;
	return xml.substr(begin, end - begin);
}
开发者ID:baidang201,项目名称:sixpieces,代码行数:14,代码来源:xmlHandler.cpp

示例10: Escape

void CCSVWriter::WriteRevisions (std::ostream& os, const CCachedLogInfo& cache)
{
	// header

	os << "Revision,AuthorID,TimeStamp,Comment,"
	   << "HasStdInfo,HasChangeInfo,HasMergeInfo,HasUserRevPropInfo\n";

	// content

	const CRevisionIndex& revisions = cache.GetRevisions();
	const CRevisionInfoContainer& logInfo = cache.GetLogInfo();

	for ( revision_t revision = revisions.GetFirstRevision()
		, last = revisions.GetLastRevision()
		; revision < last
		; ++revision)
	{
		index_t index = revisions[revision];
        if (index == NO_INDEX)
            continue;

		std::string comment = logInfo.GetComment (index);
		Escape (comment);

		char presenceFlags = logInfo.GetPresenceFlags (index);
		bool hasStdInfo 
			= (presenceFlags & CRevisionInfoContainer::HAS_STANDARD_INFO) != 0;
		bool hasChangeInfo
			= (presenceFlags & CRevisionInfoContainer::HAS_CHANGEDPATHS) != 0;
		bool hasMergeInfo 
			= (presenceFlags & CRevisionInfoContainer::HAS_MERGEINFO) != 0;
		bool hasRevPropInfo 
			= (presenceFlags & CRevisionInfoContainer::HAS_USERREVPROPS) != 0;

        enum {BUFFER_SIZE = 100};
        char buffer[BUFFER_SIZE];

        __time64_t timestamp = logInfo.GetTimeStamp(index);

		os << revision << ','
		   << logInfo.GetAuthorID(index) << ','
		   << Time64ToZuluString (buffer, timestamp) << ",\""
		   << comment.c_str() << "\","
		   << hasStdInfo << ','
		   << hasChangeInfo << ','
		   << hasMergeInfo << ','
		   << hasRevPropInfo
		   << "\n";
	}
}
开发者ID:fatterbetter,项目名称:ZTools,代码行数:50,代码来源:CSVWriter.cpp

示例11: KG_PROCESS_ERROR

void KAIBase::OnEscape(void)
{
	// 决定是否还要逃跑
	BOOL bRetCode = FALSE;

	KG_PROCESS_ERROR(g_pSO3World->m_nGameLoop < m_EscapeData.nEscapeFrame);

	Escape();
	return;
Exit0:
	// 不跑了,开打
	DoPursuit();
	return;
}
开发者ID:1suming,项目名称:pap2,代码行数:14,代码来源:KAIBase.cpp

示例12: if

LTBOOL CScreenFailure::HandleKeyDown(int key, int rep)
{
	if (key == VK_F9)
	{
		g_pMissionMgr->StartGameFromQuickSave();
		return LTTRUE;
	}
	else if (g_fDuration > g_fMinDelay)
	{
		Escape();
		return LTTRUE;
	}
	return LTFALSE;

}
开发者ID:Arc0re,项目名称:lithtech,代码行数:15,代码来源:ScreenFailure.cpp

示例13: StdLib

void StdLib(ArrayMap<String, SVal>& global)
{
	Escape(global, "is_number(x)", SIC_is_number);
	Escape(global, "is_string(x)", SIC_is_string);

	Escape(global, "def_fn(x, y)", SIC_DefFn);
	Escape(global, "count(x)", SIC_count);
	Escape(global, "get_item(x, i)", SIC_get_item);
	Escape(global, "get_key(x, i)", SIC_get_key);
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:10,代码来源:StdLib.cpp

示例14: Escape

    std::string Args::EscapedArgs(int start, int end) const {
        std::string res;

        if (end < 0) {
            end = args.size() - 1;
        }

        for (int i = start; i < end + 1; i++) {
            if (i != start) {
                res += " ";
            }
            res += Escape(args[i]);
        }

        return res;
    }
开发者ID:Foe-of-Eternity,项目名称:Unvanquished,代码行数:16,代码来源:Command.cpp

示例15: switch

void Game_Battle::UseSkill(Battle::Ally& ally, const RPG::Skill& skill) {

	int sp = ally.GetActor()->CalculateSkillCost(skill.ID);
	if (sp > ally.GetActor()->GetSp()) // not enough SP
		return;

	switch (skill.type) {
		case RPG::Skill::Type_teleport:
			// FIXME: teleport skill
			break;
		case RPG::Skill::Type_escape:
			Escape();
			break;
		case RPG::Skill::Type_switch:
			if (!skill.occasion_battle)
				return;
			Game_Switches[skill.switch_id] = true;
			break;
		case RPG::Skill::Type_normal:
		default:
			switch (skill.scope) {
				case RPG::Skill::Scope_enemy:
					UseSkillEnemy(ally, skill, Game_Battle::GetTargetEnemy());
					return;
				case RPG::Skill::Scope_enemies:
					for (std::vector<Battle::Enemy>::iterator it = Game_Battle::enemies.begin(); it != Game_Battle::enemies.end(); it++)
						UseSkillEnemy(ally, skill, *it);
					break;
				case RPG::Skill::Scope_self:
					UseSkillAlly(ally, skill, ally);
					break;
				case RPG::Skill::Scope_ally:
					UseSkillAlly(ally, skill, Game_Battle::GetTargetAlly());
					return;
				case RPG::Skill::Scope_party:
					for (std::vector<Battle::Ally>::iterator it = Game_Battle::allies.begin(); it != Game_Battle::allies.end(); it++)
						UseSkillAlly(ally, skill, *it);
					break;
			}
			break;
	}

	if (skill.type != RPG::Skill::Type_normal)
		Game_System::SePlay(skill.sound_effect);

	ally.GetActor()->SetSp(ally.GetActor()->GetSp() - sp);
}
开发者ID:ChrisOelmueller,项目名称:Player,代码行数:47,代码来源:battle_algorithms.cpp


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