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


C++ CMyString类代码示例

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


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

示例1: VerifyCorrectWorkIstreamOperator

void VerifyCorrectWorkIstreamOperator(std::string const &str)
{
	std::istringstream strm(str);
	CMyString myStr;
	strm >> myStr;
	BOOST_CHECK_EQUAL(myStr.GetStringData(), str);
}
开发者ID:oMystique,项目名称:OOP,代码行数:7,代码来源:MyStringTests.cpp

示例2: PEG_METHOD_ENTER

/////////////////////////////////////////////////////////////////////////////
// WMIClassProvider::deleteClass
//
// ///////////////////////////////////////////////////////////////////////////
void WMIClassProvider::deleteClass(const String& nameSpace,
								   const String& userName,
								   const String& password,
								   const String& className)
{
	HRESULT hr;
	
	PEG_METHOD_ENTER(TRC_WMIPROVIDER,"WMIClassProvider::deleteClass()");

	CComPtr<IWbemServices> pServices;

	//Connect to namespace
	setup(nameSpace,userName,password);
	
	bool bConnected = _collector->Connect(&pServices);
	
	if (!bConnected) 
	{
		if (pServices)
			pServices.Release();

		throw CIMException(CIM_ERR_ACCESS_DENIED);
	}
	
	//Convert the parameters to make the WMI call
	CComBSTR bsClassName = className.getCString();
	
	LONG lFlags = 0L;

	//Perform the WMI operation
	hr = pServices->DeleteClass(bsClassName,
							    lFlags,
								NULL,
								NULL);
	if (pServices)
		pServices.Release();

	//Handle the WMI operation result
	if (FAILED(hr))
	{
		CMyString msg;
		msg.Format("Failed to delete class [%s]. Error: 0x%X", 255, className.getCString(), hr);

		Tracer::trace(TRC_WMIPROVIDER, Tracer::LEVEL3, 
						  "WMIClassProvider::deleteClass() - %s", (LPCTSTR)msg);

		switch (hr)
		{
			case WBEM_E_ACCESS_DENIED: throw CIMException(CIM_ERR_ACCESS_DENIED); break;
			case WBEM_E_FAILED: throw CIMException(CIM_ERR_FAILED); break;
			case WBEM_E_INVALID_PARAMETER: throw CIMException(CIM_ERR_FAILED, "WMI Invalid Parameter"); break;
			case WBEM_E_INVALID_CLASS: throw CIMException(CIM_ERR_NOT_FOUND); break;
			case WBEM_E_NOT_FOUND: throw CIMException(CIM_ERR_NOT_FOUND); break;
			case WBEM_E_CLASS_HAS_CHILDREN: throw CIMException(CIM_ERR_CLASS_HAS_CHILDREN); break;
			default: throw CIMException(CIM_ERR_FAILED, (LPCTSTR)msg);
		}
	}

	PEG_METHOD_EXIT();
}
开发者ID:,项目名称:,代码行数:64,代码来源:

示例3: main

int main(){
	CMyString ss = "141412";
	CMyString aa = "111111";
	CMyString bb, cc, dd;
	aa = cc = aa;
	dd = aa;
	aa.Print();
	dd.Print();
	return 0;
}
开发者ID:Gavinthisisit,项目名称:Codes,代码行数:10,代码来源:Offer.cpp

示例4: FlagString

CMyString CMyString::FlagString(int val, int* valList, CMyString* strList, int num)
{
   CMyString dst;
   for (int i=0; i<num; i++) {
      if (val & valList[i]) {
         if (!dst.IsEmpty()) dst += _T("|");
         dst += strList[i];
      }
   }
   if (dst.IsEmpty()) dst << (int)val; 
   return dst;
}
开发者ID:vinnie38170,项目名称:klImageCore,代码行数:12,代码来源:MyString.cpp

示例5: HttpQueryInfo

int CMyAsyncHttp::HttpQueryInfo(HINTERNET request,CMyString &info,int code)
{
	unsigned long rl=0;
	::HttpQueryInfo(request,code,NULL,&rl,0);

	if(rl>0)
	{
		info.Resize(rl+1);
		return ::HttpQueryInfo(request,code,info.GetBuffer(),&rl,0);
	}
	return false;
}
开发者ID:zhangdq,项目名称:MyLibOfMySelf,代码行数:12,代码来源:MyAsyncHttp.cpp

示例6: DescrName

void CFunc::GetAlpha(BOOL& src, BOOL& dst) const
{
   src = dst = FALSE;
   CMyString sDescr = DescrName();
   CMyString srcStr = firstChanStr(sDescr);
   CMyString dstStr = firstChanStr(sDescr);
   src = alphaChannel(srcStr);
   if (dstStr.IsEmpty())
      dst = src;
   else
      dst = alphaChannel(dstStr);
}
开发者ID:vinnie38170,项目名称:klImageCore,代码行数:12,代码来源:Func.cpp

示例7: FuncBase

CFunc CParmStatDlg::GetFunc(int index, int dstType) 
{
   CMyString funcBase = FuncBase(index);
   CMyString typeName;
   if (TypeFlag(funcBase))
      typeName = TypeName(dstType);
   CFunc func = "ipps" + funcBase + "_" + typeName;
   if (typeName.IsEmpty())
      func += m_pDocSrc->GetVector()->TypeString();
   if (func.DstType() & PP_SIGN)
      func += "_Sfs";
   return func;
}
开发者ID:vinnie38170,项目名称:klImageCore,代码行数:13,代码来源:ParmStatDlg.cpp

示例8: GetDirName

	void GetDirName(CMyString &path)
	{
		int len=path.GetStrLen();
		int start=0;
		for(int i=len-1;i>=0;i++)
		{
			if(path[i]=='/')
			{
				start=i+1;
				break;
			}
		}
		m_TempStr=path.GetSubStr(start);
		if(path[len-1]=='/')
			m_TempStr.EraseFromRight(1);
	}
开发者ID:almondyoung,项目名称:MyLibOfMySelf,代码行数:16,代码来源:SpiderTest.cpp

示例9: numChannels

static int numChannels(CMyString str)
{
   if (str.IsEmpty()) return 0;
   CMyString numStr((str[0] == 'A') ? str[2] : str[1]);
   int num = _ttoi(numStr);
   if (num > 4) num = 0;
   return num;
}
开发者ID:vinnie38170,项目名称:klImageCore,代码行数:8,代码来源:Func.cpp

示例10: _T

void CFunc::GetChannelsName(CMyString& src, CMyString& dst) const
{
   src = dst = _T("");
   CMyString sDescr = DescrName();
   src = firstChanStr(sDescr);
   dst = firstChanStr(sDescr);
   if (dst.IsEmpty()) dst = src;
}
开发者ID:vinnie38170,项目名称:klImageCore,代码行数:8,代码来源:Func.cpp

示例11:

int	CMyAsyncHttp::HttpGetStatusCode(HINTERNET request,int &code)
{
	CMyString str;
	code=0;

	if(HttpQueryInfo(request,str,HTTP_QUERY_STATUS_CODE))
	{
		code=str.ToInt();
	};
#ifdef _DEBUG
	int d=::GetLastError();
	if(d==ERROR_HTTP_HEADER_NOT_FOUND)
	{
		LOG(TAG,"HttpGetStatusCode,can't find the header!");
	}
#endif
	return 1;
}
开发者ID:zhangdq,项目名称:MyLibOfMySelf,代码行数:18,代码来源:MyAsyncHttp.cpp

示例12: CompareNoCase

int CMyString::CompareNoCase(CMyString strVal_UP) const	// Compare respect to "strVal", case insensitive
{
	CMyString			strThis_UP = *this;

	strThis_UP.MakeUpper();
	strVal_UP.MakeUpper();

	return strThis_UP.Compare(strVal_UP);
}
开发者ID:maxspot,项目名称:MFCClasses_in_ATL,代码行数:9,代码来源:MyString.cpp

示例13:

void 
CMyNumString::SetString(const CMyString &str)
{
    if (!CheckNum(str.GetString()))
    {
        return;
    }

    CMyString::SetString(str);
}
开发者ID:xuwenbo,项目名称:KR_CPP,代码行数:10,代码来源:CMyString.cpp

示例14: HttpGetCharset

int CMyAsyncHttp::HttpGetCharset(HINTERNET request,CMyString &charset)
{
	CMyString str;
	if(HttpQueryInfo(request,str,HTTP_QUERY_CONTENT_TYPE))
	{
		char *p=str.GetBuffer();
		p=strstr(p,"charset=");
		if(p)charset=p+8;
		return 1;
	}
#ifdef _DEBUG
	int d=::GetLastError();
	if(d==ERROR_HTTP_HEADER_NOT_FOUND)
	{
		LOG(TAG,"HttpGetCharset,can't find the header!");
	}
#endif
	return 1;
	
}
开发者ID:zhangdq,项目名称:MyLibOfMySelf,代码行数:20,代码来源:MyAsyncHttp.cpp

示例15: PickSetID

BOOL CippsRun::PickSetID(CMyString& vectorName, UINT& pickID, UINT& grabID)
{
   if (m_PickVecPos == VEC_SRC3) {
      vectorName = m_Func.VecName(VEC_SRC3,m_UsedVectors);
      if (m_Func.Inplace()) {
         vectorName = "SrcDst";
         pickID = IDC_CURSOR_PSD;
         grabID = IDC_CURSOR_SD;
      } else {
         vectorName = "Src3";
         pickID = IDC_CURSOR_PS3;
         grabID = IDC_CURSOR_S3;
      }
   } else if (m_PickVecPos == VEC_SRC2) {
      vectorName = m_Func.VecName(VEC_SRC2,m_UsedVectors);
      if (vectorName.Found("Im")) {
         pickID = IDC_CURSOR_PIM;
         grabID = IDC_CURSOR_IM;
      } else if (vectorName.Found("Phase")) {
         pickID = IDC_CURSOR_PPH;
         grabID = IDC_CURSOR_PH;
      } else if (vectorName.Found("High")) {
         pickID = IDC_CURSOR_PHI;
         grabID = IDC_CURSOR_HI;
      } else if (vectorName.Found("Ref")) {
         pickID = IDC_CURSOR_PR;
         grabID = IDC_CURSOR_R;
      } else if (!(m_UsedVectors & VEC_SRC3) && m_Func.Inplace()) {
         vectorName = "SrcDst";
         pickID = IDC_CURSOR_PSD;
         grabID = IDC_CURSOR_SD;
      } else {
         vectorName = "Src2";
         pickID = IDC_CURSOR_PS2;
         grabID = IDC_CURSOR_S2;
      }
   } else {
      return FALSE;
   }
   return TRUE;
}
开发者ID:vinnie38170,项目名称:klImageCore,代码行数:41,代码来源:ippsRun.cpp


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