本文整理汇总了C++中CFX_WideStringC::Left方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_WideStringC::Left方法的具体用法?C++ CFX_WideStringC::Left怎么用?C++ CFX_WideStringC::Left使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_WideStringC
的用法示例。
在下文中一共展示了CFX_WideStringC::Left方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FILESPEC_DecodeFileName
static CFX_WideString FILESPEC_DecodeFileName(const CFX_WideStringC& filepath) {
if (filepath.GetLength() <= 1) {
return CFX_WideString();
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
if (filepath.Left(sizeof("/Mac") - 1) == CFX_WideStringC(L"/Mac")) {
return ChangeSlashToPlatform(filepath.GetPtr() + 1);
}
return ChangeSlashToPlatform(filepath.GetPtr());
#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
if (filepath.GetAt(0) != '/') {
return ChangeSlashToPlatform(filepath.GetPtr());
}
if (filepath.GetAt(1) == '/') {
return ChangeSlashToPlatform(filepath.GetPtr() + 1);
}
if (filepath.GetAt(2) == '/') {
CFX_WideString result;
result += filepath.GetAt(1);
result += ':';
result += ChangeSlashToPlatform(filepath.GetPtr() + 2);
return result;
}
CFX_WideString result;
result += '\\';
result += ChangeSlashToPlatform(filepath.GetPtr());
return result;
#else
return filepath;
#endif
}
示例2: DecodeFileName
CFX_WideString CPDF_FileSpec::DecodeFileName(const CFX_WideStringC& filepath) {
if (filepath.GetLength() <= 1)
return CFX_WideString();
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
if (filepath.Left(sizeof("/Mac") - 1) == CFX_WideStringC(L"/Mac"))
return ChangeSlashToPlatform(filepath.c_str() + 1);
return ChangeSlashToPlatform(filepath.c_str());
#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
if (filepath.GetAt(0) != '/')
return ChangeSlashToPlatform(filepath.c_str());
if (filepath.GetAt(1) == '/')
return ChangeSlashToPlatform(filepath.c_str() + 1);
if (filepath.GetAt(2) == '/') {
CFX_WideString result;
result += filepath.GetAt(1);
result += ':';
result += ChangeSlashToPlatform(filepath.c_str() + 2);
return result;
}
CFX_WideString result;
result += '\\';
result += ChangeSlashToPlatform(filepath.c_str());
return result;
#else
return CFX_WideString(filepath);
#endif
}
示例3: FILESPEC_EncodeFileName
CFX_WideString FILESPEC_EncodeFileName(const CFX_WideStringC& filepath) {
if (filepath.GetLength() <= 1) {
return CFX_WideString();
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
if (filepath.GetAt(1) == ':') {
CFX_WideString result;
result = '/';
result += filepath.GetAt(0);
if (filepath.GetAt(2) != '\\') {
result += '/';
}
result += ChangeSlashToPDF(filepath.GetPtr() + 2);
return result;
}
if (filepath.GetAt(0) == '\\' && filepath.GetAt(1) == '\\') {
return ChangeSlashToPDF(filepath.GetPtr() + 1);
}
if (filepath.GetAt(0) == '\\') {
CFX_WideString result;
result = '/';
result += ChangeSlashToPDF(filepath.GetPtr());
return result;
}
return ChangeSlashToPDF(filepath.GetPtr());
#elif _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
if (filepath.Left(sizeof("Mac") - 1) == FX_WSTRC(L"Mac")) {
CFX_WideString result;
result = '/';
result += ChangeSlashToPDF(filepath.GetPtr());
return result;
}
return ChangeSlashToPDF(filepath.GetPtr());
#else
return filepath;
#endif
}