本文整理汇总了C++中nglString::GetChars方法的典型用法代码示例。如果您正苦于以下问题:C++ nglString::GetChars方法的具体用法?C++ nglString::GetChars怎么用?C++ nglString::GetChars使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nglString
的用法示例。
在下文中一共展示了nglString::GetChars方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RegisterDataType
nglNativeObjectType nglDataTypesRegistry::RegisterDataType(const nglString& rMimeType, nglNativeObjectType Type, nglDataObjectCreatorFunc pCreator)
{
#ifdef _WIN32_
if (!Type)
Type = RegisterClipboardFormat((LPCTSTR)(rMimeType.GetChars()));
if (!Type)
{
NGL_LOG(_T("nglNativeObjectTypesRegistry"), NGL_LOG_ERROR, _T("RegisterDragAndDropNativeType: Can't RegisterClipboardFormat(\")%s\")"), rMimeType.GetChars());
}
#endif
{
std::map<nglString, nglNativeObjectType>::iterator it = mRegisteredNativeTypes.find(rMimeType);
if (it != mRegisteredNativeTypes.end())
Type = it->second;
else
// dynamically generate a new Type
{
if (Type == 'nui3')
{
uint32 size = mRegisteredNativeTypes.size(); // use the size (on 24bits, we should not have any overflow:) ) of the map as a unique index
Type = ('n' << 24) | (size & 0xffffff);
}
// LBTODO ?
mDataObjectCreators[rMimeType] = pCreator;
mRegisteredNativeTypes[rMimeType] = Type;
}
}
return Type;
}
示例2: MsgError
bool ProjectGenerator::MsgError(const nglString& error)
{
nglString msg;
msg.Format(_T("error %ls"), error.GetChars());
NGL_OUT(msg);
nuiMessageBox* pMessageBox = new nuiMessageBox(GetMainWindow(), _T("Project Creator"), msg, eMB_OK);
pMessageBox->QueryUser();
return false;
}
示例3: OnOutput
void nglConsole::OnOutput(const nglString& rText)
{
// 'char' mode : string buffer is considered to use the locale's encoding
Append(rText.GetChars());
// Write to the standard win32 console:
#ifdef USE_STANDARD_WIN32_CONSOLE
unsigned long res = 0;
WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE),rText.GetChars(),rText.GetLength(),&res,NULL);
#endif
// I don't care if this is slow, its really mandatory in win32.
vector<nglString> vec;
uint ret=rText.Tokenize(vec, _T('\n'));
for (uint i=0; i<ret; i++)
{
OutputDebugString(vec[i].GetChars()); // fixme! to be removed ?
OutputDebugString(_T("\n"));
}
}
示例4: SetClipboard
bool nglKernel::SetClipboard(const nglString& rString)
{
if (OpenClipboard(mHWnd))
{
EmptyClipboard();
HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, rString.GetLength()+1);
if (hglbCopy == NULL)
{
CloseClipboard();
return false;
}
char* lptstrCopy = (char*)GlobalLock(hglbCopy);
memcpy(lptstrCopy, rString.GetChars(), rString.GetLength()+1);
GlobalUnlock(hglbCopy);
SetClipboardData(CF_TEXT, hglbCopy);
CloseClipboard();
return true;
}
return false;
}
示例5: Init
void nuiMessageBox::Init(const nglString& rTitle, nuiWidget* pContents, nuiMessageBoxType type, bool showIcon)
{
SetObjectClass(_T("nuiMessageBox"));
mType = type;
mKeyDown = false;
mClickedButton = ButtonCancel;
nuiVBox* pVBox = new nuiVBox();
pVBox->SetExpand(nuiExpandShrinkAndGrow);
pVBox->SetObjectName(_T("nuiMessageBox::Client"));
AddChild(pVBox);
nuiLabel* pTitle = new nuiLabel(rTitle);
pTitle->SetObjectName(_T("nuiMessageBox::Title"));
pTitle->SetObjectClass(_T("nuiMessageBox::Title"));
pVBox->AddCell(pTitle);
nuiHBox* pHBox = new nuiHBox(2);
pHBox->SetExpand(nuiExpandShrinkAndGrow);
pHBox->SetObjectName(_T("nuiMessageBox::Contents"));
pVBox->AddCell(pHBox);
pVBox->SetCellExpand(pVBox->GetNbCells()-1, nuiExpandShrinkAndGrow);
if (showIcon)
{
nuiSimpleContainer* pIcon = new nuiSimpleContainer();
nglString objectName;
objectName.Format(_T("nuiMessageBox::Icon"), rTitle.GetChars());
pIcon->SetObjectName(objectName);
pHBox->SetCell(0, pIcon, nuiCenter);
}
pHBox->SetCell(1, pContents);
pHBox->SetCellExpand(1, nuiExpandShrinkAndGrow);
mpBtnBox = new nuiHBox();
mpBtnBox->SetObjectName(_T("nuiMessageBox::ButtonBox"));
pVBox->AddCell(mpBtnBox);
mpBtnBox->AddCell(NULL);
mpBtnBox->SetCellExpand(mpBtnBox->GetNbCells()-1, nuiExpandShrinkAndGrow);
switch (mType)
{
case eMB_OK:
mpBtnBox->AddCell(CreateOK());
mpBtnBox->SetPosition(nuiCenter);
break;
case eMB_Cancel:
mpBtnBox->AddCell(CreateCancel());
mpBtnBox->SetPosition(nuiCenter);
break;
case eMB_OKCancel:
mpBtnBox->AddCell(CreateOK());
mpBtnBox->AddCell(CreateCancel());
break;
case eMB_RetryOKCancel:
mpBtnBox->AddCell(CreateRetry());
mpBtnBox->AddCell(CreateOK());
mpBtnBox->AddCell(CreateCancel());
break;
case eMB_YesNo:
mpBtnBox->AddCell(CreateYes());
mpBtnBox->AddCell(CreateNo());
break;
case eMB_Custom:
break;
}
SetPosition(nuiCenter);
GetTopLevel()->SetFocus(this);
// default decoration
nuiDefaultDecoration::MessageBox(this);
}
示例6: RegisterAPI
void nuiAudioDeviceManager::RegisterAPI(const nglString& rAPIName, nuiAudioDeviceAPI* pAPI)
{
NGL_LOG(_T("nuiAudioDeviceManager"), NGL_LOG_DEBUG, _T("RegisterAPI('%s') [0x%x]\n"), rAPIName.GetChars(), pAPI);
nuiAudioAPIMap::const_iterator end = mAPIs.end();
nuiAudioAPIMap::const_iterator it = mAPIs.find(rAPIName);
if (it != end)
{
nuiAudioDeviceAPI* pOldAPI = it->second;
NGL_LOG(_T("nuiAudioDeviceManager"), NGL_LOG_DEBUG, _T("\tkilling previous entry for this API [0x%p]\n"), pOldAPI);
delete pOldAPI;
}
mAPIs[rAPIName] = pAPI;
Update();
}
示例7: Send
int nuiTCPClient::Send(const nglString& rString)
{
return Send((uint8*)rString.GetChars(), rString.GetLength());
}
示例8: Write
size_t nuiPipe::Write(const nglString& rString)
{
return Write((const uint8*)rString.GetChars(), rString.GetLength());
}
示例9: BufferedSend
size_t nuiTCPClient::BufferedSend(const nglString& rString, bool BufferOnly)
{
return BufferedSend((uint8*)rString.GetChars(), rString.GetLength(), BufferOnly);
}
示例10: nglPath_SetVolume
bool nglPath_SetVolume(nglPathVolume& rVolume,
nglString& rMPoint,
nglString& rDevice,
nglString& rFSType,
nglString& rOptions)
{
rVolume.mPath = nglPath(rMPoint);
rVolume.mFlags = nglPathVolume::Offline;
rVolume.mType = nglPathVolume::eTypeUnknown;
if ((rMPoint == _T("none")) ||
(rMPoint == _T("/")) ||
(rMPoint == _T("/boot")) ||
(rMPoint == _T("/usr")) ||
(rMPoint == _T("/usr/local")) ||
(rMPoint == _T("/var")) ||
(rMPoint == _T("/tmp")) ||
(rMPoint == _T("/home")))
{
rVolume.mFlags |= nglPathVolume::System;
}
if (!rDevice.Compare(_T("/dev/hd"), 0, 7))
{
int controler = (rDevice[7] - 'a') / 2 + 1;
int channel = (rDevice[7] - 'a') % 2;
int partition = rDevice[8] - '0';
rVolume.mComment.Format(_T("%s on %d%s partition (%s on %d%s IDE controler)"),
rFSType.GetChars(),
partition, _intrank(partition),
channel ? _T("slave") : _T("master"),
controler, _intrank(controler));
}
else
if (!rDevice.Compare(_T("/dev/sd"), 0, 7))
{
int dev = rDevice[7] - 'a';
int partition = rDevice[8] - '0';
rVolume.mComment.Format(_T("%s on %d%s partition (%d%s SCSI device)"),
rFSType.GetChars(),
partition, _intrank(partition),
dev, _intrank(dev));
rVolume.mType = nglPathVolume::eTypeHD;
}
else
if ((!rDevice.Compare(_T("/dev/sr"), 0, 7)) ||
(!rDevice.Compare(_T("/dev/sg"), 0, 7)))
{
int dev = rDevice[7] - '0' + 1;
rVolume.mComment.Format(_T("%s (%d%s SCSI device)"),
rFSType.GetChars(),
dev, _intrank(dev));
rVolume.mFlags |= nglPathVolume::Removable;
rVolume.mType = nglPathVolume::eTypeCD;
}
else
if (!rDevice.Compare(_T("/dev/fd"), 0, 7))
{
int dev = rDevice[7] - '0' + 1;
rVolume.mComment.Format(_T("%d%s floppy"), dev, _intrank(dev));
rVolume.mFlags |= nglPathVolume::Removable;
rVolume.mType = nglPathVolume::eTypeFloppy;
}
if (rFSType == _T("smbfs"))
{
rVolume.mComment.Format(_T("%s (SMB)"), rDevice.GetChars());
rVolume.mType = nglPathVolume::eTypeNetwork;
}
else
if (rFSType == _T("nfs"))
{
rVolume.mComment.Format(_T("%s (NFS)"), rDevice.GetChars());
rVolume.mType = nglPathVolume::eTypeNetwork;
}
else
if ((rFSType == _T("proc")) ||
(rFSType == _T("devfs")) ||
(rFSType == _T("usbdevfs")) ||
(rFSType == _T("devpts")))
{
rVolume.mComment = rFSType;
rVolume.mFlags |= nglPathVolume::System;
}
if (nglPath_IsRO(rOptions))
rVolume.mFlags |= nglPathVolume::ReadOnly;
return true;
}