您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetNV函数代码示例

51自学网 2021-06-01 21:11:21
  C++
这篇教程C++ GetNV函数代码示例写得很实用,希望能帮到您。

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

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

示例1: HandleMessage

	void HandleMessage(CNick& Nick, const CString& sMessage) {		CString sNickServName = (!GetNV("NickServName").empty()) ? GetNV("NickServName") : "NickServ";		if (!GetNV("Password").empty()				&& Nick.NickEquals(sNickServName)				&& (sMessage.find("msg") != CString::npos				 || sMessage.find("authenticate") != CString::npos				 || sMessage.find("choose a different nickname") != CString::npos				 || sMessage.find("please choose a different nick") != CString::npos				 || sMessage.find("If this is your nick, identify yourself with") != CString::npos				 || sMessage.find("If this is your nick, type") != CString::npos				 || sMessage.find("This is a registered nickname, please identify") != CString::npos				 || sMessage.StripControls_n().find("type /NickServ IDENTIFY password") != CString::npos)				&& sMessage.AsUpper().find("IDENTIFY") != CString::npos				&& sMessage.find("help") == CString::npos) {			MCString msValues;			msValues["password"] = GetNV("Password");			PutIRC(CString::NamedFormat(GetNV("IdentifyCmd"), msValues));		}	}
开发者ID:Brijen,项目名称:znc,代码行数:19,


示例2: OnIRCConnecting

    EModRet OnIRCConnecting(CIRCSock* pIRCSock) override {        if (m_pISpoofLockFile != nullptr) {            DEBUG("Aborting connection, ident spoof lock file exists");            PutModule(                t_s("Aborting connection, another user or network is currently "                    "connecting and using the ident spoof file"));            return HALTCORE;        }        if (!WriteISpoof()) {            DEBUG("identfile [" + GetNV("File") + "] could not be written");            PutModule(                t_f("[{1}] could not be written, retrying...")(GetNV("File")));            return HALTCORE;        }        SetIRCSock(pIRCSock);        return CONTINUE;    }
开发者ID:BtbN,项目名称:znc,代码行数:19,


示例3: SilentCommand

	void SilentCommand(const CString& sLine) {		const CString sValue = sLine.Token(1);		if (!sValue.empty()) {			SetNV("silent_timeouts", sValue);		}		CString sPrefix = GetNV("silent_timeouts").ToBool() ? "dis" : "en";		PutModule("Timeout messages are " + sPrefix + "abled.");	}
开发者ID:Brijen,项目名称:znc,代码行数:10,


示例4: CheckRequireAuth

	bool CheckRequireAuth() {		if (!m_bAuthenticated && GetNV(NV_REQUIRE_AUTH).ToBool()) {			GetNetwork()->SetIRCConnectEnabled(false);			PutModule("Disabling network, we require authentication.");			PutModule("Use 'RequireAuth no' to disable.");			return true;		}		return false;	}
开发者ID:ConorOG,项目名称:znc,代码行数:10,


示例5: GetFake

	CString GetFake(const CString& name) {		CString stored = GetNV(name);				if(stored.empty()) {			stored = IncIp();			SetNV(name, stored);		}				return CGIIRC_IP_PREFIX + stored;	}
开发者ID:Googolplexed,项目名称:znc,代码行数:10,


示例6: GetMechanismsString

	CString GetMechanismsString() const {		if (GetNV(NV_MECHANISMS).empty()) {			CString sDefaults = "";			for (size_t i = 0; SupportedMechanisms[i].szName != NULL; i++) {				if (SupportedMechanisms[i].bDefault) {					if (!sDefaults.empty()) {						sDefaults += " ";					}					sDefaults += SupportedMechanisms[i].szName;				}			}			return sDefaults;		}		return GetNV(NV_MECHANISMS);	}
开发者ID:ConorOG,项目名称:znc,代码行数:19,


示例7: DelCtcp

    void DelCtcp(const CString& sCtcp) {        // Remove a ctcp request to the ctcp queries we're listening to.        CString sCtcpNotifier = sCtcp.Token(1).AsUpper();        if (!GetNV("ctcp_" + sCtcpNotifier).empty()) {            DelNV("ctcp_" + sCtcpNotifier);            PutModule("Deleted CTCP notifier: " + sCtcpNotifier);        } else {            PutModule("Could not find CTCP notifier: " + sCtcpNotifier);        }    }
开发者ID:ChaoticDividend,项目名称:znc-modules,代码行数:11,


示例8: AddCtcp

    void AddCtcp(const CString& sCtcp) {        // Add a ctcp request from the ctcp queries we're listening to.        CString sCtcpNotifier = sCtcp.Token(1).AsUpper();        if (GetNV("ctcp_" + sCtcpNotifier).empty()) {            SetNV("ctcp_" + sCtcpNotifier, "y");            PutModule("Added CTCP notifier: " + sCtcpNotifier);        } else {            PutModule("CTCP notifier for " + sCtcpNotifier + " was already set.");        }    }
开发者ID:ChaoticDividend,项目名称:znc-modules,代码行数:11,


示例9: RequireAuthCommand

    void RequireAuthCommand(const CString& sLine) {        if (!sLine.Token(1).empty()) {            SetNV(NV_REQUIRE_AUTH, sLine.Token(1));        }        if (GetNV(NV_REQUIRE_AUTH).ToBool()) {            PutModule("We require SASL negotiation to connect");        } else {            PutModule("We will connect even if SASL fails");        }    }
开发者ID:DreamBNC,项目名称:znc,代码行数:11,


示例10: OnModCommand

	virtual void OnModCommand(const CString& sCommand) {		CString sCmd = sCommand.Token(0);				if (sCmd.Equals("settoken")) {			CString sToken = sCommand.Token(1,true);			if (!sToken.empty()) {				if (SetNV("token",sToken)) {					PutModule("Token [" + sToken + "] setted");				} else {					PutModule("Token set error (?)");				}							} else {				//PutModule("Usage SetToken <token>");				if (DelNV("token")) PutModule("Token deleted.");			}		} else if (sCmd.Equals("setpassword")) {			CString sPassw = sCommand.Token(1,true);			if (!sPassw.empty()) {				if (SetNV("password",sPassw)) {					PutModule("Password setted");				} else {					PutModule("Password set error (?)");				}			} else {				//PutModule("Usage SetPassword <password>");				if (DelNV("password")) PutModule("Passwored deleted.");			}		} else if (sCmd.Equals("show")) {			PutModule("Token: [" + GetNV("token") + "]");			PutModule("Password: [" + GetNV("password") + "]");		} else if (sCmd.Equals("HELP")) {			PutModule("Try: Show, SetToken, SetPassword");		} else {			PutModule("Unknown command, try 'Help'");		}	}
开发者ID:asturel,项目名称:znc_modules,代码行数:41,


示例11: OnLoad

	virtual bool OnLoad(const CString& sArgs, CString& sMessage)	{		if (sArgs.empty())			m_sPass = GetNV("Password");		else {			m_sPass = sArgs;			SetNV("Password", m_sPass);			SetArgs("");		}		return true;	}
开发者ID:ZachBeta,项目名称:znc,代码行数:12,


示例12: OnLoad

    bool OnLoad(const CString& sArgs, CString& sMessage) override {        if (!sArgs.empty() && sArgs != "<hidden>") {            SetNV("Password", sArgs);            SetArgs("<hidden>");        }        if (GetNV("IdentifyCmd").empty()) {            SetNV("IdentifyCmd", "NICKSERV IDENTIFY {password}");        }        return true;    }
开发者ID:sctigercat1,项目名称:znc,代码行数:12,


示例13: WriteISpoof

    bool WriteISpoof() {        if (m_pISpoofLockFile != nullptr) {            return false;        }        m_pISpoofLockFile = new CFile;        if (!m_pISpoofLockFile->TryExLock(GetNV("File"), O_RDWR | O_CREAT)) {            delete m_pISpoofLockFile;            m_pISpoofLockFile = nullptr;            return false;        }        char buf[1024];        memset((char*)buf, 0, 1024);        m_pISpoofLockFile->Read(buf, 1024);        m_sOrigISpoof = buf;        if (!m_pISpoofLockFile->Seek(0) || !m_pISpoofLockFile->Truncate()) {            delete m_pISpoofLockFile;            m_pISpoofLockFile = nullptr;            return false;        }        CString sData = ExpandString(GetNV("Format"));        // If the format doesn't contain anything expandable, we'll        // assume this is an "old"-style format string.        if (sData == GetNV("Format")) {            sData.Replace("%", GetUser()->GetIdent());        }        DEBUG("Writing [" + sData + "] to ident spoof file [" +              m_pISpoofLockFile->GetLongName() + "] for user/network [" +              GetUser()->GetUserName() + "/" + GetNetwork()->GetName() + "]");        m_pISpoofLockFile->Write(sData + "/n");        return true;    }
开发者ID:BtbN,项目名称:znc,代码行数:39,


示例14: GetReply

	CString GetReply() {		CString sReply = GetNV("Reply");		if (sReply.empty()) {			sReply = "%nick% is currently away, try again later";			SetReply(sReply);		}		if (m_pNetwork) {			return m_pNetwork->ExpandString(sReply);		}		return m_pUser->ExpandString(sReply);	}
开发者ID:jimloco,项目名称:znc,代码行数:13,


示例15: GetAwayReason

	CString GetAwayReason() const {		CString sAway = GetNV("reason");		if (sAway.empty()) {			sAway = AWAY_DEFAULT_REASON;		}		if (m_pNetwork) {			return m_pNetwork->ExpandString(sAway);		}		return m_pUser->ExpandString(sAway);	}
开发者ID:rask330,项目名称:znc-contrib,代码行数:13,


示例16: OnLoad

	virtual bool OnLoad(const CString& sArgs, CString& sMessage) {		if (!sArgs.empty())			m_sFormat = sArgs;		else			m_sFormat = GetNV("nick");		if (m_sFormat.empty()) {			m_sFormat = "zz_%nick%";		}		SetNV("nick", m_sFormat);		return true;	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:14,


示例17: PutIRC

void CUrlBufferModule::CheckLineForTrigger(const CString& sMessage, const CString& sTarget){	if(GetNV("enablepublic").ToBool())	{		VCString words;		sMessage.Split(" ", words, false, "", "", true, true);		for (size_t a = 0; a < words.size(); a++) 		{			CString& word = words[a];			if(word.AsLower() == "!showlinks")			{				if(lastUrls.empty())					PutIRC("PRIVMSG " + sTarget + " :No links were found...");				else 				{					unsigned int maxLinks = GetNV("buffersize").ToUInt();													if (a+1 < words.size())					{						unsigned int size = words[a+1].ToUInt();						if(size!=0 && size<UINT_MAX) //if it was a valid number							maxLinks = size;					}                                                            unsigned int maxSize = lastUrls.size()-1;                    for(unsigned int i=0; i<=maxSize && i<maxLinks; i++)                    {                          sleep(1);                          PutIRC("PRIVMSG " + sTarget + " :" + nicks[maxSize-i] + ": "+ lastUrls[maxSize-i]);                    }				}			}		}	}}
开发者ID:ChaoticDividend,项目名称:znc-modules,代码行数:36,


示例18: OnLoad

	virtual bool OnLoad(const CString& sArgs, CString& sMessage) {		if (!sArgs.empty()) {			SetNV("Password", sArgs);			SetArgs("");		}		if (GetNV("IdentifyCmd").empty()) {			SetNV("IdentifyCmd", "PRIVMSG NickServ :IDENTIFY {password}");		}		if (GetNV("GhostCmd").empty()) {			SetNV("GhostCmd", "PRIVMSG NickServ :GHOST {nickname} {password}");		}		if (GetNV("RecoverCmd").empty()) {			SetNV("RecoverCmd", "PRIVMSG NickServ :RECOVER {nickname} {password}");		}		if (GetNV("ReleaseCmd").empty()) {			SetNV("ReleaseCmd", "PRIVMSG NickServ :RELEASE {nickname} {password}");		}		if (GetNV("GroupCmd").empty()) {			SetNV("GroupCmd", "PRIVMSG NickServ :GROUP {nickname} {password}");		}		return true;	}
开发者ID:KTE,项目名称:znc,代码行数:24,


示例19: OnModCommand

	virtual void OnModCommand(const CString& sCommand) {		const CString& sCmd = sCommand.Token(0);		if (sCmd.Equals("SHOW")) {			PutModule("Current reply is: " + GetNV("Reply")					+ " (" + GetReply() + ")");		} else if (sCmd.Equals("SET")) {			SetReply(sCommand.Token(1, true));			PutModule("New reply set");		} else {			PutModule("Available commands are:");			PutModule("Show        - Displays the current query reply");			PutModule("Set <reply> - Sets a new reply");		}	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:15,


示例20: OnLoad

	virtual bool OnLoad(const CString & sArgs, CString & sMessage) {		CString sTarget = GetNV("target");		if (sTarget.Equals("syslog"))			m_eLogMode = LOG_TO_SYSLOG;		else if (sTarget.Equals("both"))			m_eLogMode = LOG_TO_BOTH;		else if (sTarget.Equals("file"))			m_eLogMode = LOG_TO_FILE;		else			m_eLogMode = LOG_TO_FILE;		m_sLogFile = GetSavePath() + "/znc.log";		Log("Logging started. ZNC PID[" + CString(getpid()) + "] UID/GID[" + CString(getuid()) + ":" + CString(getgid()) + "]");		return true;	}
开发者ID:evaryont,项目名称:znc,代码行数:16,


示例21: SetNV

void CUrlBufferModule::LoadDefaults() {	if(GetNV("enable")=="")		SetNV("enable", "true", true);	if(GetNV("enablelocal")=="")		SetNV("enablelocal", "false", true);	if(GetNV("buffersize")== "")		SetNV("buffersize", "5", true);	if(GetNV("enablepublic")=="")		SetNV("enablepublic", "true", true);	if(GetNV("bufferalllinks")=="")		SetNV("bufferalllinks", "false", true);    if(GetNV("reupload")=="")        SetNV("reupload", "true", true);    }
开发者ID:ChaoticDividend,项目名称:znc-modules,代码行数:15,


示例22: OnLoad

	virtual bool OnLoad(const CString& sArgs, CString& sErrorMsg) {		if (sArgs.empty()) {			CString sDelay = GetNV("delay");			if (sDelay.empty())				delay = 10;			else				delay = sDelay.ToUInt();		} else {			int i = sArgs.ToInt();			if ((i == 0 && sArgs == "0") || i > 0)				delay = i;			else {				sErrorMsg = "Illegal argument, "					"must be a positive number or 0";				return false;			}		}		return true;	}
开发者ID:bpcampbe,项目名称:znc,代码行数:21,


示例23: OnModCommand

	virtual void OnModCommand(const CString& sCommand) {		const CString sCmd = sCommand.Token(0);		const CString sArgs = sCommand.Token(1, true);		if (sCmd.Equals("silent")) {			if (sArgs.Equals("yes")) {				SetNV("silent_timeouts", "yes");				PutModule("Disabled timeout messages");			} else if (sArgs.Equals("no")) {				DelNV("silent_timeouts");				PutModule("Enabled timeout messages");			} else if (sArgs.empty()) {				if (GetNV("silent_timeouts") == "yes")					PutModule("Timeout messages are disabled");				else					PutModule("Timeout message are enabled");			} else				PutModule("Invalid argument");		} else {			PutModule("Available commands: silent [yes/no], silent");		}	}
开发者ID:ZachBeta,项目名称:znc,代码行数:22,


示例24: Timeout

	void Timeout()	{		// The timer will be deleted after this by the event loop		if (GetNV("silent_timeouts") != "yes") {			PutModule("This module hit a timeout which is possibly a bug.");			PutModule("Use /"silent yes/" to disable this message.");			PutModule("Last request: " + m_sLastRequest);			PutModule("Expected replies: ");			for (size_t i = 0; m_pReplies[i].szReply != NULL; i++) {				if (m_pReplies[i].bLastResponse)					PutModule(m_pReplies[i].szReply +							CString(" (last)"));				else					PutModule(m_pReplies[i].szReply);			}		}		m_pDoing = NULL;		m_pReplies = NULL;		SendRequest();	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:23,


示例25: GetFormat

	void GetFormat(const CString& sLine) {		PutModule("Format is set to: " + GetNV("Format"));		PutModule("Format would be expanded to: " + ExpandString(GetNV("Format")));	}
开发者ID:ConorOG,项目名称:znc,代码行数:4,


示例26: SetFormat

	void SetFormat(const CString& sLine) {		SetNV("Format", sLine.Token(1, true));		PutModule("Format has been set to: " + GetNV("Format"));		PutModule("Format would be expanded to: " + ExpandString(GetNV("Format")));	}
开发者ID:ConorOG,项目名称:znc,代码行数:5,


示例27: SetFile

	void SetFile(const CString& sLine) {		SetNV("File", sLine.Token(1, true));		PutModule("File has been set to: " + GetNV("File"));	}
开发者ID:ConorOG,项目名称:znc,代码行数:4,


示例28: GetFile

	void GetFile(const CString& sLine) {		PutModule("File is set to: " + GetNV("File"));	}
开发者ID:ConorOG,项目名称:znc,代码行数:3,


示例29: ShouldCloneUser

	bool ShouldCloneUser() {		return !GetNV("CloneUser").empty();	}
开发者ID:54lman,项目名称:znc,代码行数:3,


示例30: CloneUser

	CString CloneUser() const {		return GetNV("CloneUser");	}
开发者ID:54lman,项目名称:znc,代码行数:3,



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


C++ GetNameLink函数代码示例
C++ GetNArray函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。