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


C++ CString::AsLower方法代码示例

本文整理汇总了C++中CString::AsLower方法的典型用法代码示例。如果您正苦于以下问题:C++ CString::AsLower方法的具体用法?C++ CString::AsLower怎么用?C++ CString::AsLower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CString的用法示例。


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

示例1:

std::vector<CChan*> CIRCNetwork::FindChans(const CString& sWild) const {
    std::vector<CChan*> vChans;
    vChans.reserve(m_vChans.size());
    const CString sLower = sWild.AsLower();
    for (CChan* pChan : m_vChans) {
        if (pChan->GetName().AsLower().WildCmp(sLower)) vChans.push_back(pChan);
    }
    return vChans;
}
开发者ID:torksrevol,项目名称:znc,代码行数:9,代码来源:IRCNetwork.cpp

示例2: ChannelMatches

	bool ChannelMatches(const CString& sChan) const {
		for (set<CString>::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); ++it) {
			if (sChan.AsLower().WildCmp(*it)) {
				return true;
			}
		}

		return false;
	}
开发者ID:DrRenX,项目名称:znc,代码行数:9,代码来源:autovoice.cpp

示例3: OnNick

	virtual void OnNick(const CNick& OldNick, const CString& sNewNick, const vector<CChan*>& vChans) {
		// Update the queue with nick changes
		MCString::iterator it = m_msQueue.find(OldNick.GetNick().AsLower());

		if (it != m_msQueue.end()) {
			m_msQueue[sNewNick.AsLower()] = it->second;
			m_msQueue.erase(it);
		}
	}
开发者ID:stevestreza,项目名称:ZNC-Node,代码行数:9,代码来源:autoop.cpp

示例4:

std::vector<CQuery*> CIRCNetwork::FindQueries(const CString& sWild) const {
	std::vector<CQuery*> vQueries;
	vQueries.reserve(m_vQueries.size());
	const CString sLower = sWild.AsLower();
	for (CQuery* pQuery : m_vQueries) {
		if (pQuery->GetName().AsLower().WildCmp(sLower))
			vQueries.push_back(pQuery);
	}
	return vQueries;
}
开发者ID:Hasimir,项目名称:znc,代码行数:10,代码来源:IRCNetwork.cpp

示例5: AddKey

    bool AddKey(CUser* pUser, const CString& sKey) {
        const pair<SCString::const_iterator, bool> pair =
            m_PubKeys[pUser->GetUserName()].insert(sKey.AsLower());

        if (pair.second) {
            Save();
        }

        return pair.second;
    }
开发者ID:Adam-,项目名称:znc,代码行数:10,代码来源:certauth.cpp

示例6: WildCmp

bool CString::WildCmp(const CString& sWild, const CString& sString, CaseSensitivity cs) {
	// avoid a copy when cs == CaseSensitive (C++ deliberately specifies that binding
	// a temporary object to a reference to const on the stack lengthens the lifetime
	// of the temporary to the lifetime of the reference itself)
	const CString& sWld = (cs == CaseSensitive ? sWild : sWild.AsLower());
	const CString& sStr = (cs == CaseSensitive ? sString : sString.AsLower());

	// Written by Jack Handy - [email protected]
	const char *wild = sWld.c_str(), *CString = sStr.c_str();
	const char *cp = nullptr, *mp = nullptr;

	while ((*CString) && (*wild != '*')) {
		if ((*wild != *CString) && (*wild != '?')) {
			return false;
		}

		wild++;
		CString++;
	}

	while (*CString) {
		if (*wild == '*') {
			if (!*++wild) {
				return true;
			}

			mp = wild;
			cp = CString+1;
		} else if ((*wild == *CString) || (*wild == '?')) {
			wild++;
			CString++;
		} else {
			wild = mp;
			CString = cp++;
		}
	}

	while (*wild == '*') {
		wild++;
	}

	return (*wild == 0);
}
开发者ID:EpicnessTwo,项目名称:znc,代码行数:43,代码来源:ZNCString.cpp

示例7: SendIRCMsgToSkype

	bool SendIRCMsgToSkype(const CString& a_nick, const CString& a_channel, const CString& a_message)
	{
		if(m_chanNameMap.find(a_channel.AsLower()) != m_chanNameMap.end() && !a_message.empty())
		{
			CString l_message = stripIRCColorCodes(a_message);

			if(!IsStrValidUTF8(l_message))
			{
				l_message = AnsiToUtf8(l_message);
			}

			if(!a_nick.empty())
			{
				l_message = "<" + a_nick + "> " + l_message;
			}

			return SendSkypeCommand("CHATMESSAGE " + m_chanNameMap[a_channel.AsLower()] + " " + l_message);
		}
		return false;
	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:20,代码来源:modskype.cpp

示例8: DelUser

	void DelUser(const CString& sUser) {
		map<CString, CAutoVoiceUser*>::iterator it = m_msUsers.find(sUser.AsLower());

		if (it == m_msUsers.end()) {
			PutModule("That user does not exist");
			return;
		}

		delete it->second;
		m_msUsers.erase(it);
		PutModule("User [" + sUser + "] removed");
	}
开发者ID:BlaXpirit,项目名称:znc,代码行数:12,代码来源:autovoice.cpp

示例9: OnDelKeyCommand

	void OnDelKeyCommand(const CString& sCommand) {
		CString sTarget = sCommand.Token(1);

		if (!sTarget.empty()) {
			if (DelNV(sTarget.AsLower())) {
				PutModule("Target [" + sTarget + "] deleted");
			} else {
				PutModule("Target [" + sTarget + "] not found");
			}
		} else {
			PutModule("Usage DelKey <#chan|Nick>");
		}
	}
开发者ID:jpnurmi,项目名称:znc,代码行数:13,代码来源:crypt.cpp

示例10: OnSetKeyCommand

	void OnSetKeyCommand(const CString& sCommand) {
		CString sTarget = sCommand.Token(1);
		CString sKey = sCommand.Token(2, true);

		// Strip "cbc:" from beginning of string incase someone pastes directly from mircryption
		sKey.TrimPrefix("cbc:");

		if (!sKey.empty()) {
			SetNV(sTarget.AsLower(), sKey);
			PutModule("Set encryption key for [" + sTarget + "] to [" + sKey + "]");
		} else {
			PutModule("Usage: SetKey <#chan|Nick> <Key>");
		}
	}
开发者ID:jpnurmi,项目名称:znc,代码行数:14,代码来源:crypt.cpp

示例11: FilterIncoming

	void FilterIncoming(const CString& sTarget, CNick& Nick, CString& sMessage) {
		if (sMessage.TrimPrefix("+OK *")) {
			MCString::iterator it = FindNV(sTarget.AsLower());

			if (it != EndNV()) {
				sMessage.Base64Decode();
				sMessage.Decrypt(it->second);
				sMessage.LeftChomp(8);
				sMessage = sMessage.c_str();
				Nick.SetNick(NickPrefix() + Nick.GetNick());
			}
		}

	}
开发者ID:jpnurmi,项目名称:znc,代码行数:14,代码来源:crypt.cpp

示例12: GetKey

    CString GetKey(Csock* pSock) {
        CString sRes;
        long int res = pSock->GetPeerFingerprint(sRes);

        DEBUG("GetKey() returned status " << res << " with key " << sRes);

        // This is 'inspired' by charybdis' libratbox
        switch (res) {
            case X509_V_OK:
            case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN:
            case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE:
            case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
                return sRes.AsLower();
            default:
                return "";
        }
    }
开发者ID:Adam-,项目名称:znc,代码行数:17,代码来源:certauth.cpp

示例13: OnUserTopic

	EModRet OnUserTopic(CString& sTarget, CString& sMessage) override {
		sTarget.TrimPrefix(NickPrefix());

		if (sMessage.TrimPrefix("``")) {
			return CONTINUE;
		}

		MCString::iterator it = FindNV(sTarget.AsLower());

		if (it != EndNV()) {
			sMessage = MakeIvec() + sMessage;
			sMessage.Encrypt(it->second);
			sMessage.Base64Encode();
			sMessage = "+OK *" + sMessage;
		}

		return CONTINUE;
	}
开发者ID:jpnurmi,项目名称:znc,代码行数:18,代码来源:crypt.cpp

示例14: SendNotification

    bool SendNotification(CNick& Nick, CString& sMessage){
        /*
         * Being passed in the nick name and the message, return true if an
         * email notification should be sent to the user or not. At the moment
         * this is a simple test that checks for a case insenstive username
         * match which is a bit flawed as 1d0ugal1 still matches d0ugal.
         */

        // Don't send notifications if DebugMode is off and the ConnectedUser is not attached.
        if (!DebugMode && ConnectedUser->IsUserAttached()){
            return false;
        }

        CString UserNick = ConnectedUser->GetNick().AsLower();

        size_t found = sMessage.AsLower().find(UserNick);

        if (found!=string::npos){
            return true;
        } else {
            return false;
        }

    }
开发者ID:CircleCode,项目名称:znc_mailer,代码行数:24,代码来源:mailer.cpp

示例15: Parse

// Config Parser. Might drop this.
bool CConfig::Parse(CFile& file, CString& sErrorMsg)
{
	CString sLine;
	unsigned int uLineNum = 0;
	CConfig *pActiveConfig = this;
	std::stack<ConfigStackEntry> ConfigStack;
	bool bCommented = false;     // support for /**/ style comments

	if (!file.Seek(0)) {
		sErrorMsg = "Could not seek to the beginning of the config.";
		return false;
	}

	while (file.ReadLine(sLine)) {
		uLineNum++;

#define ERROR(arg) do { \
	std::stringstream stream; \
	stream << "Error on line " << uLineNum << ": " << arg; \
	sErrorMsg = stream.str(); \
	m_SubConfigs.clear(); \
	m_ConfigEntries.clear(); \
	return false; \
} while (0)

		// Remove all leading spaces and trailing line endings
		sLine.TrimLeft();
		sLine.TrimRight("\r\n");

		if (bCommented || sLine.Left(2) == "/*") {
			/* Does this comment end on the same line again? */
			bCommented = (sLine.Right(2) != "*/");

			continue;
		}

		if ((sLine.empty()) || (sLine[0] == '#') || (sLine.Left(2) == "//")) {
			continue;
		}

		if ((sLine.Left(1) == "<") && (sLine.Right(1) == ">")) {
			sLine.LeftChomp();
			sLine.RightChomp();
			sLine.Trim();

			CString sTag = sLine.Token(0);
			CString sValue = sLine.Token(1, true);

			sTag.Trim();
			sValue.Trim();

			if (sTag.Left(1) == "/") {
				sTag = sTag.substr(1);

				if (!sValue.empty())
					ERROR("Malformated closing tag. Expected \"</" << sTag << ">\".");
				if (ConfigStack.empty())
					ERROR("Closing tag \"" << sTag << "\" which is not open.");

				const struct ConfigStackEntry& entry = ConfigStack.top();
				CConfig myConfig(entry.Config);
				CString sName(entry.sName);

				if (!sTag.Equals(entry.sTag))
					ERROR("Closing tag \"" << sTag << "\" which is not open.");

				// This breaks entry
				ConfigStack.pop();

				if (ConfigStack.empty())
					pActiveConfig = this;
				else
					pActiveConfig = &ConfigStack.top().Config;

				SubConfig &conf = pActiveConfig->m_SubConfigs[sTag.AsLower()];
				SubConfig::const_iterator it = conf.find(sName);

				if (it != conf.end())
					ERROR("Duplicate entry for tag \"" << sTag << "\" name \"" << sName << "\".");

				conf[sName] = CConfigEntry(myConfig);
			} else {
				if (sValue.empty())
					ERROR("Empty block name at begin of block.");
				ConfigStack.push(ConfigStackEntry(sTag.AsLower(), sValue));
				pActiveConfig = &ConfigStack.top().Config;
			}

			continue;
		}

		// If we have a regular line, figure out where it goes
		CString sName = sLine.Token(0, false, "=");
		CString sValue = sLine.Token(1, true, "=");

		// Only remove the first space, people might want
		// leading spaces (e.g. in the MOTD).
		if (sValue.Left(1) == " ")
			sValue.LeftChomp();
//.........这里部分代码省略.........
开发者ID:tmfksoft,项目名称:FreeNC,代码行数:101,代码来源:Config.cpp


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