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


C++ AString::Replace方法代码示例

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


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

示例1: PropToString

static AString PropToString(const NCOM::CPropVariant &prop, PROPID propID)
{
  AString s;

  if (prop.vt == VT_BSTR)
    s = GetSystemString(prop.bstrVal, CP_OEMCP);
  else if (prop.vt == VT_BOOL)
  {
    int messageID = VARIANT_BOOLToBool(prop.boolVal) ?
      NMessageID::kYes : NMessageID::kNo;
    return g_StartupInfo.GetMsgString(messageID);
  }
  else if (prop.vt != VT_EMPTY)
  {
    if ((
        propID == kpidSize ||
        propID == kpidPackSize ||
        propID == kpidNumSubDirs ||
        propID == kpidNumSubFiles ||
        propID == kpidNumBlocks ||
        propID == kpidPhySize ||
        propID == kpidHeadersSize ||
        propID == kpidClusterSize
        ) && (prop.vt == VT_UI8 || prop.vt == VT_UI4))
      s = ConvertSizeToString(ConvertPropVariantToUInt64(prop));
    else
      s = UnicodeStringToMultiByte(ConvertPropertyToString(prop, propID), CP_OEMCP);
  }
  s.Replace((char)0xA, ' ');
  s.Replace((char)0xD, ' ');
  return s;
}
开发者ID:BIAINC,项目名称:7Zip,代码行数:32,代码来源:Plugin.cpp

示例2: GetName

 AString GetName() const
 {
   AString dirName = GetDirName();
   const char kDirSeparator = CHAR_PATH_SEPARATOR; // '\\';
   // check kDirSeparator in Linux
   dirName.Replace((char)(unsigned char)0xFF, kDirSeparator);
   if (!dirName.IsEmpty() && dirName.Back() != kDirSeparator)
     dirName += kDirSeparator;
   return dirName + GetFileName();
 }
开发者ID:OwenTan,项目名称:AndroidP7zip,代码行数:10,代码来源:LzhHandler.cpp

示例3: CreateMe

AAboutForm* AAboutForm::CreateMe()
{
	afc_object<AMLBody> pBody(new AMLBody());
	AString xml;
	xml = g_szFormXML;
	xml.Replace(_T("@"),_T("\""));
	pBody->FromXML(xml);
	AAboutForm* p = dynamic_cast<AAboutForm*>( AControl::CreateInstance(&pBody,AApplication::Get()) );
	return p;
}
开发者ID:emuikernel,项目名称:BaijieCppUILib,代码行数:10,代码来源:AAboutForm.cpp

示例4: CreateFromXML

void AColorDialogForm::CreateFromXML()
{
	afc_object<AMLBody> pBody(new AMLBody());
	AString xml;
	xml = g_szDialogWnd;
	xml.Replace(_T("@"),_T("\""));
	pBody->FromXML(xml);
	this->FromXML(&pBody);
	this->CenterToScreen();
}
开发者ID:emuikernel,项目名称:BaijieCppUILib,代码行数:10,代码来源:AColorDialogForm.cpp

示例5: CreateFromXML

void AMessageForm::CreateFromXML(TDialogButton db)
{
	m_dbs = db;
	afc_object<AMLBody> pBody(new AMLBody());
	AString xml;
	xml = g_szDialogWnd;
	xml.Replace(_T("@"),_T("\""));
	pBody->FromXML(xml);
	this->FromXML(&pBody);
	this->CenterToScreen();
}
开发者ID:emuikernel,项目名称:BaijieCppUILib,代码行数:11,代码来源:AMessageForm.cpp

示例6: ReadJPEGInfo

bool ReadJPEGInfo(const char *filename, JPEG_INFO& info)
{
	EXIFINFO exinfo;
	Exif exif(&exinfo);
	FILE *fp;
	bool success = false;

	memset(&exinfo, 0, sizeof(exinfo));

	if ((fp = fopen(filename, "rb")) != NULL) {
		if (exif.DecodeExif(fp)) {
			info.CameraMake  = exinfo.CameraMake;
			info.CameraModel = exinfo.CameraModel;
			info.Width  	 = exinfo.Width;
			info.Height 	 = exinfo.Height;
			info.Orientation = exinfo.Orientation;
			info.bDateValid  = false;
			info.Comments    = exinfo.Comments;

			AString str = exinfo.DateTime;

			if (str.Valid()) {
				//printf("File '%s' has date '%s'\n", filename, str.str());

				str.Replace(":/-.", "    ");
				
				ADateTime& dt = info.DateTime;
				uint_t word = 0;
				
				uint16_t year   = str.Word(word++);
				uint8_t  month  = str.Word(word++);
				uint8_t  day    = str.Word(word++);
				uint8_t  hour   = str.Word(word++);
				uint8_t  minute = str.Word(word++);
				uint8_t  second = str.Word(word++);

				if ((year >= 1980) && RANGE(month, 1, 12) && RANGE(day, 1, 31) && (hour <= 23) && (minute <= 59) && (second <= 61)) {
					dt.Set(day, month, year, hour, minute, second);
					
					info.bDateValid = true;
				}
			}

			success = true;
		}
		
		fclose(fp);
	}

	return success;
}
开发者ID:richardxday,项目名称:rdlib,代码行数:51,代码来源:jpeginfo.cpp


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