本文整理汇总了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);
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例13:
void
CMyNumString::SetString(const CMyString &str)
{
if (!CheckNum(str.GetString()))
{
return;
}
CMyString::SetString(str);
}
示例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;
}
示例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;
}