当前位置: 首页>>代码示例>>C++>>正文


C++ Blob::Size方法代码示例

本文整理汇总了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;
  }
开发者ID:thenfour,项目名称:LibCC,代码行数:31,代码来源:winapi.hpp

示例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;
}
开发者ID:nerdalize,项目名称:deltares-delft3d,代码行数:35,代码来源:context-flowside.cpp


注:本文中的Blob::Size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。