本文整理汇总了C++中CFX_ByteStringC::GetCStr方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_ByteStringC::GetCStr方法的具体用法?C++ CFX_ByteStringC::GetCStr怎么用?C++ CFX_ByteStringC::GetCStr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_ByteStringC
的用法示例。
在下文中一共展示了CFX_ByteStringC::GetCStr方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FXJSE_ThrowMessage
void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name,
const CFX_ByteStringC& utf8Message) {
v8::Isolate* pIsolate = v8::Isolate::GetCurrent();
ASSERT(pIsolate);
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(pIsolate);
v8::Local<v8::String> hMessage = v8::String::NewFromUtf8(
pIsolate, utf8Message.GetCStr(), v8::String::kNormalString,
utf8Message.GetLength());
v8::Local<v8::Value> hError;
if (utf8Name == "RangeError") {
hError = v8::Exception::RangeError(hMessage);
} else if (utf8Name == "ReferenceError") {
hError = v8::Exception::ReferenceError(hMessage);
} else if (utf8Name == "SyntaxError") {
hError = v8::Exception::SyntaxError(hMessage);
} else if (utf8Name == "TypeError") {
hError = v8::Exception::TypeError(hMessage);
} else {
hError = v8::Exception::Error(hMessage);
if (utf8Name != "Error" && !utf8Name.IsEmpty()) {
hError.As<v8::Object>()->Set(
v8::String::NewFromUtf8(pIsolate, "name"),
v8::String::NewFromUtf8(pIsolate, utf8Name.GetCStr(),
v8::String::kNormalString,
utf8Name.GetLength()));
}
}
pIsolate->ThrowException(hError);
}
示例2: FX_File_Exist
FX_BOOL FX_File_Exist(const CFX_ByteStringC& fileName) {
FX_DWORD dwAttri = ::GetFileAttributesA(fileName.GetCStr());
if (dwAttri == -1) {
return FALSE;
}
return (dwAttri & FILE_ATTRIBUTE_DIRECTORY) == 0;
}
示例3: Open
FX_BOOL CFXCRT_FileAccess_Posix::Open(const CFX_ByteStringC& fileName,
FX_DWORD dwMode) {
if (m_nFD > -1) {
return FALSE;
}
int32_t nFlags, nMasks;
FXCRT_Posix_GetFileMode(dwMode, nFlags, nMasks);
m_nFD = open(fileName.GetCStr(), nFlags, nMasks);
return m_nFD > -1;
}
示例4: DeleteObjectProperty
FX_BOOL CFXJSE_Value::DeleteObjectProperty(const CFX_ByteStringC& szPropName) {
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject =
v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
if (!hObject->IsObject()) {
return FALSE;
}
hObject.As<v8::Object>()->Delete(v8::String::NewFromUtf8(
m_pIsolate, szPropName.GetCStr(), v8::String::kNormalString,
szPropName.GetLength()));
return TRUE;
}
示例5: FX_XML_SplitQualifiedName
void FX_XML_SplitQualifiedName(const CFX_ByteStringC& bsFullName,
CFX_ByteStringC& bsSpace,
CFX_ByteStringC& bsName) {
if (bsFullName.IsEmpty()) {
return;
}
int32_t iStart = 0;
for (; iStart < bsFullName.GetLength(); iStart++) {
if (bsFullName.GetAt(iStart) == ':') {
break;
}
}
if (iStart >= bsFullName.GetLength()) {
bsName = bsFullName;
} else {
bsSpace = CFX_ByteStringC(bsFullName.GetCStr(), iStart);
iStart++;
bsName = CFX_ByteStringC(bsFullName.GetCStr() + iStart,
bsFullName.GetLength() - iStart);
}
}
示例6:
FX_BOOL CFXCRT_FileAccess_Win64::Open(const CFX_ByteStringC& fileName,
FX_DWORD dwMode) {
if (m_hFile) {
return FALSE;
}
FX_DWORD dwAccess, dwShare, dwCreation;
FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation);
m_hFile = ::CreateFileA(fileName.GetCStr(), dwAccess, dwShare, NULL,
dwCreation, FILE_ATTRIBUTE_NORMAL, NULL);
if (m_hFile == INVALID_HANDLE_VALUE) {
m_hFile = NULL;
}
return m_hFile != NULL;
}
示例7: HasObjectOwnProperty
FX_BOOL CFXJSE_Value::HasObjectOwnProperty(const CFX_ByteStringC& szPropName,
FX_BOOL bUseTypeGetter) {
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject =
v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
if (!hObject->IsObject()) {
return FALSE;
}
v8::Local<v8::String> hKey = v8::String::NewFromUtf8(
m_pIsolate, szPropName.GetCStr(), v8::String::kNormalString,
szPropName.GetLength());
return hObject.As<v8::Object>()->HasRealNamedProperty(hKey) ||
(bUseTypeGetter && hObject.As<v8::Object>()->HasOwnProperty(hKey));
}
示例8: SetObjectOwnProperty
FX_BOOL CFXJSE_Value::SetObjectOwnProperty(const CFX_ByteStringC& szPropName,
CFXJSE_Value* lpPropValue) {
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject =
v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
if (!hObject->IsObject()) {
return FALSE;
}
v8::Local<v8::Value> hValue =
v8::Local<v8::Value>::New(m_pIsolate, lpPropValue->m_hValue);
return hObject.As<v8::Object>()->ForceSet(
v8::String::NewFromUtf8(m_pIsolate, szPropName.GetCStr(),
v8::String::kNormalString,
szPropName.GetLength()),
hValue);
}
示例9: FX_File_Move
FX_BOOL FX_File_Move(const CFX_ByteStringC& fileNameSrc,
const CFX_ByteStringC& fileNameDst) {
return ::MoveFileA(fileNameSrc.GetCStr(), fileNameDst.GetCStr());
}
示例10: FX_File_Copy
FX_BOOL FX_File_Copy(const CFX_ByteStringC& fileNameSrc,
const CFX_ByteStringC& fileNameDst) {
return ::CopyFileA(fileNameSrc.GetCStr(), fileNameDst.GetCStr(), FALSE);
}
示例11: FX_File_Delete
FX_BOOL FX_File_Delete(const CFX_ByteStringC& fileName) {
return ::DeleteFileA(fileName.GetCStr());
}
示例12: XFA_ByteStringToDouble
FX_DOUBLE XFA_ByteStringToDouble(const CFX_ByteStringC& szStringVal) {
CFX_WideString wsValue =
CFX_WideString::FromUTF8(szStringVal.GetCStr(), szStringVal.GetLength());
return XFA_WideStringToDouble(wsValue);
}