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


C++ IsoString::ResizeToNullTerminated方法代码示例

本文整理汇总了C++中IsoString::ResizeToNullTerminated方法的典型用法代码示例。如果您正苦于以下问题:C++ IsoString::ResizeToNullTerminated方法的具体用法?C++ IsoString::ResizeToNullTerminated怎么用?C++ IsoString::ResizeToNullTerminated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IsoString的用法示例。


在下文中一共展示了IsoString::ResizeToNullTerminated方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Open

bool FileFormatInstance::Open( ImageDescriptionArray& images,
                               const String& filePath, const IsoString& hints )
{
   images.Clear();

   if ( (*API->FileFormat->OpenImageFileEx)( handle, filePath.c_str(), hints.c_str(), 0/*flags*/ ) == api_false )
      return false;

   for ( uint32 i = 0, n = (*API->FileFormat->GetImageCount)( handle ); i < n; ++i )
   {
      IsoString id;
      size_type len = 0;
      (*API->FileFormat->GetImageId)( handle, 0, &len, i );
      if ( len > 0 )
      {
         id.SetLength( len );
         if ( (*API->FileFormat->GetImageId)( handle, id.Begin(), &len, i ) == api_false )
            throw APIFunctionError( "GetImageId" );
         id.ResizeToNullTerminated();
      }

      api_image_info info;
      api_image_options options;
      if ( (*API->FileFormat->GetImageDescription)( handle, &info, &options, i ) == api_false )
         throw APIFunctionError( "GetImageDescription" );

      ImageDescription d;
      d.id = id;
      APIImageInfoToPCL( d.info, info );
      APIImageOptionsToPCL( d.options, options );
      images.Add( d );
   }

   return true;
}
开发者ID:aleixpuig,项目名称:PCL,代码行数:35,代码来源:FileFormatInstance.cpp

示例2: Id

IsoString ProcessParameter::Id() const
{
   size_type len = 0;
   (*API->Process->GetParameterIdentifier)( m_data->handle, 0, &len );

   IsoString id;
   if ( len > 0 )
   {
      id.SetLength( len );
      if ( (*API->Process->GetParameterIdentifier)( m_data->handle, id.c_str(), &len ) == api_false )
         throw APIFunctionError( "GetParameterIdentifier" );
      id.ResizeToNullTerminated();
   }
   return id;
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:15,代码来源:ProcessParameter.cpp

示例3: Name

IsoString FileFormat::Name() const
{
   size_type len = 0;
   (*API->FileFormat->GetFileFormatName)( m_data->handle, 0, &len );

   IsoString name;
   if ( len > 0 )
   {
      name.SetLength( len );
      if ( (*API->FileFormat->GetFileFormatName)( m_data->handle, name.c_str(), &len ) == api_false )
         throw APIFunctionError( "GetFileFormatName" );
      name.ResizeToNullTerminated();
   }
   return name;
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:15,代码来源:FileFormat.cpp

示例4: FullId

IsoString View::FullId() const
{
   size_type len = 0;
   (*API->View->GetViewFullId)( handle, 0, &len );

   IsoString id;
   if ( len > 0 )
   {
      id.SetLength( len );
      if ( (*API->View->GetViewFullId)( handle, id.c_str(), &len ) == api_false )
         throw APIFunctionError( "GetViewFullId" );
      id.ResizeToNullTerminated();
   }
   return id;
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:15,代码来源:View.cpp

示例5: Aliases

IsoStringList ProcessParameter::Aliases() const
{
   size_type len = 0;
   (*API->Process->GetParameterAliasIdentifiers)( m_data->handle, 0, &len );

   IsoStringList aliases;
   if ( len > 0 )
   {
      IsoString csAliases;
      csAliases.SetLength( len );
      if ( (*API->Process->GetParameterAliasIdentifiers)( m_data->handle, csAliases.c_str(), &len ) == api_false )
         throw APIFunctionError( "GetParameterAliasIdentifiers" );
      csAliases.ResizeToNullTerminated();
      csAliases.Break( aliases, ',' );
   }
   return aliases;
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:17,代码来源:ProcessParameter.cpp

示例6: ReadColorFilterArray

bool FileFormatInstance::ReadColorFilterArray( ColorFilterArray& cfa )
{
   try
   {
      cfa = ColorFilterArray();

      if ( (*API->FileFormat->BeginColorFilterArrayExtraction)( handle ) == api_false )
         return false;

      size_type patternLen = 0, nameLen = 0;
      (*API->FileFormat->GetImageColorFilterArray)( handle, 0, &patternLen, 0, 0, 0, &nameLen );

      bool ok = true;
      if ( patternLen > 0 )
      {
         IsoString pattern;
         pattern.SetLength( patternLen );
         String name;
         if ( nameLen > 0 )
            name.SetLength( nameLen );
         int32 width, height;
         ok = (*API->FileFormat->GetImageColorFilterArray)( handle,
                              pattern.Begin(), &patternLen, &width, &height, name.Begin(), &nameLen ) != api_false;
         if ( ok )
         {
            pattern.ResizeToNullTerminated();
            name.ResizeToNullTerminated();
            cfa = ColorFilterArray( pattern, width, height, name );
         }
      }

      (*API->FileFormat->EndColorFilterArrayExtraction)( handle );
      return ok;
   }
   catch ( ... )
   {
      (*API->FileFormat->EndColorFilterArrayExtraction)( handle );
      throw;
   }
}
开发者ID:aleixpuig,项目名称:PCL,代码行数:40,代码来源:FileFormatInstance.cpp

示例7: EnumerationElements

ProcessParameter::enumeration_element_list ProcessParameter::EnumerationElements() const
{
   if ( !IsEnumeration() )
      return enumeration_element_list();

   size_type count = (*API->Process->GetParameterElementCount)( m_data->handle );
   if ( count == 0 )
      throw APIFunctionError( "GetParameterElementCount" );

   enumeration_element_list elements( count );

   for ( size_type i = 0; i < count; ++i )
   {
      size_type len = 0;
      (*API->Process->GetParameterElementIdentifier)( m_data->handle, i, 0, &len );
      if ( len == 0 )
         throw APIFunctionError( "GetParameterElementIdentifier" );
      elements[i].id.SetLength( len );
      if ( (*API->Process->GetParameterElementIdentifier)( m_data->handle, i, elements[i].id.c_str(), &len ) == api_false )
         throw APIFunctionError( "GetParameterElementIdentifier" );
      elements[i].id.ResizeToNullTerminated();

      len = 0;
      (*API->Process->GetParameterElementAliasIdentifiers)( m_data->handle, i, 0, &len );
      if ( len > 0 )
      {
         IsoString aliases;
         aliases.SetLength( len );
         if ( (*API->Process->GetParameterElementAliasIdentifiers)( m_data->handle, i, aliases.c_str(), &len ) == api_false )
            throw APIFunctionError( "GetParameterElementAliasIdentifiers" );
         aliases.ResizeToNullTerminated();
         aliases.Break( elements[i].aliases, ',' );
      }

      elements[i].value = (*API->Process->GetParameterElementValue)( m_data->handle, i );
   }

   return elements;
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:39,代码来源:ProcessParameter.cpp


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