本文整理汇总了C++中Blob::Size方法的典型用法代码示例。如果您正苦于以下问题:C++ Blob::Size方法的具体用法?C++ Blob::Size怎么用?C++ Blob::Size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blob
的用法示例。
在下文中一共展示了Blob::Size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCurrentDirectoryX
bool GetCurrentDirectoryX(std::basic_string<Char, Traits, Alloc>& out)
{
Blob<Char> buf;
//TCHAR* tsz = 0;
DWORD dwRet = 0;
bool r = false;
dwRet = GetCurrentDirectoryW(static_cast<DWORD>(buf.Size()), buf.GetBuffer());
if(dwRet)
{
if(dwRet > static_cast<DWORD>(buf.Size()))
{
// It needs more space.
if(buf.Alloc(dwRet+2))
{
if(::GetCurrentDirectory(static_cast<DWORD>(buf.Size()), buf.GetBuffer()))
{
out = buf.GetBuffer();
r = true;
}
}
}
else
{
out = buf.GetBuffer();
r = true;
}
}
return r;
}
示例2: Exception
int D3dFlowContextFlowSide::ReceiveBlobFromMapper(
DDBlobID blobID, // Identifier of blob to be sent
int maxNumBytes, // max #bytes that can be received
char * bytes // pointer to (already allocated) array of bytes
)
{
MAPDBG_FUN2("D3dFlowContext::ReceiveBlobFromMapper");
int numInBytes = 0;
if ( this->mapperIterator == NULL )
{
throw new Exception (true, "ReceiveFromMapper: mapperIterator not set for Flow \"%s\"",
this->flowIterator == NULL ? "????" : this->flowIterator->name );
}
else
{
FLOW2D3D->dd->log->Write (Log::DDMAPPER_MINOR, "FLOW \"%s\" WAITS for blob %d from mapper \"%s\"",
this->flowIterator->name, blobID, this->mapperIterator->name);
int incomingBlobID=0;
Blob * receiveBlob = new Blob(bytes, maxNumBytes);
this->mapperIterator->Receive(receiveBlob, &incomingBlobID); // ddd-comm: mapper->flow, some blob
numInBytes = receiveBlob->Size();
delete receiveBlob;
if ( incomingBlobID != blobID )
{
throw new Exception (true, "D3dFlowContextFlowSide::ReceiveBlobFromMapper: unexpected blobID (%d /= %d)",
incomingBlobID, blobID);
}
FLOW2D3D->dd->log->Write (Log::DDMAPPER_MINOR, "FLOW \"%s\" RECEIVED blob %d from mapper \"%s\"",
this->flowIterator->name, blobID, this->mapperIterator->name);
}
return numInBytes;
}