本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}