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

C++ Escape函数代码示例

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

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



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


示例16: Escape

// https://developer.twitter.com
// /en/docs/basics/authentication/guides/creating-a-signature.html
std::string Network::CalcSignature(
	const std::string &http_method, const std::string &base_url,
	const KeyValue &oauth_param, const KeyValue &query_param,
	const std::string &consumer_secret, const std::string &token_secret)
{
	// "Collecting parameters"
	// percent encode しつつ合成してキーでソートする
	KeyValue param;
	auto encode_insert = [this, &param](const KeyValue &map) {
		for (const auto &entry : map) {
			param.emplace(Escape(entry.first), Escape(entry.second));
		}
	};
	encode_insert(oauth_param);
	encode_insert(query_param);
	// 文字列にする
	// key1=value1&key2=value2&...
	std::string param_str;
	bool is_first = true;
	for (const auto &entry : param) {
		if (is_first) {
			is_first = false;
		}
		else {
			param_str += '&';
		}
		param_str += entry.first;
		param_str += '=';
		param_str += entry.second;
	}

	// "Creating the signature base string"
	// 署名対象
	std::string base = http_method;
	base += '&';
	base += Escape(base_url);
	base += '&';
	base += Escape(param_str);

	// "Getting a signing key"
	// 署名鍵は consumer_secret と token_secret をエスケープして & でつなぐだけ
	std::string key = Escape(consumer_secret);
	key += '&';
	key += Escape(token_secret);

	// "Calculating the signature"
	ShaDigest signature;
	HmacSha1(
		key.data(), key.size(),
		reinterpret_cast<const unsigned char *>(base.data()), base.size(),
		signature);

	return Base64Encode(signature, sizeof(signature));
}
开发者ID:yappy,项目名称:DollsKit,代码行数:56,代码来源:net.cpp


示例17: ASSERT

CRect CPrinterDC::PrintableArea(void) const
{
	ASSERT(m_hDC);

	CPoint	ptOffset(0, 0);
	CRect	rcPage = PageArea();

	// Get margin and adjust page.
	if (Escape(m_hDC, GETPRINTINGOFFSET, 0, NULL, &ptOffset) > 0)
	{
		rcPage.left    += ptOffset.x;
		rcPage.top     += ptOffset.y;
		rcPage.right   -= ptOffset.x;
		rcPage.bottom  -= ptOffset.y;
	}
	
	return rcPage;
}
开发者ID:chrisoldwood,项目名称:WIN16,代码行数:18,代码来源:PrintrDC.cpp


示例18: SaveStr

void SaveStr(char *param) {
    if ( (posBytesLeft <= 3) || !posSave)
        return;

    posBytesLeft -= 3;  // subtract 3 for the 2 quotation marks and the space

    if (*posSave == 0)
        *posSave++ = ' ';

    int len = lstrlen(param);

    *posSave++ = '"';
    len += Escape(posSave, param, '"');
    posSave += len;

    *posSave++ = '"';
    *posSave   = 0;
    posBytesLeft -= len;
}
开发者ID:doozan,项目名称:si_plugins,代码行数:19,代码来源:StrLib.cpp


示例19: _T

void CXMLElement::ToString(CString& strXML, BOOL bNewline) const
{
	// strXML += '<' + m_sName; Optimzed:
	strXML.AppendChar( _T('<') );
	strXML.Append( m_sName );

	POSITION pos = GetAttributeIterator();
	for ( ; pos ; )
	{
		strXML.AppendChar( _T(' ') );
		const CXMLAttribute* pAttribute = GetNextAttribute( pos );
		pAttribute->ToString( strXML );
	}

	pos = GetElementIterator();

	if ( pos == NULL && m_sValue.IsEmpty() )
	{
		strXML.Append( _PT("/>") );
		if ( bNewline )
			strXML.Append( _PT("\r\n") );
		return;
	}

	strXML.AppendChar( _T('>') );
	if ( bNewline && pos )
		strXML.Append( _PT("\r\n") );

	while ( pos )
	{
		const CXMLElement* pElement = GetNextElement( pos );
		pElement->ToString( strXML, bNewline );
	}

	strXML += Escape( m_sValue );

	strXML.Append( _PT("</") );
	strXML.Append( m_sName );
	strXML.AppendChar( _T('>') );
	if ( bNewline )
		strXML.Append( _PT("\r\n") );
}
开发者ID:lemonxiao0,项目名称:peerproject,代码行数:42,代码来源:XML.cpp


示例20: WriteStrings

bool WriteStrings(ostream& out,
                  const string& header,
                  StringTable& strings,
                  bool escape)
{
  out << "[" << header << "]" << std::endl;
  for (StringTable::iterator iter = strings.begin();
       iter != strings.end();
       iter++) {
    out << iter->first << "=";
    if (escape)
      out << Escape(iter->second);
    else
      out << iter->second;

    out << std::endl;
  }

  return true;
}
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:20,代码来源:crashreporter.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ EscapeCommFunction函数代码示例发布时间:2022-05-30
下一篇:
C++ Error_set_str函数代码示例发布时间: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