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