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


C++ IsoString类代码示例

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


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

示例1: WriteColorFilterArray

bool FileFormatInstance::WriteColorFilterArray( const ColorFilterArray& cfa )
{
   try
   {
      if ( (*API->FileFormat->BeginColorFilterArrayEmbedding)( handle ) == api_false )
         return false;

      IsoString pattern = cfa.Pattern();
      pattern.EnsureUnique();
      String name = cfa.Name();
      name.EnsureUnique();

      bool ok = (*API->FileFormat->SetImageColorFilterArray)( handle,
                           pattern.c_str(), cfa.Width(), cfa.Height(), name.c_str() ) != api_false;

      if ( cfa.Pattern() != pattern || cfa.Name() != name )
         APIHackingAttempt( "WriteColorFilterArray" );

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

示例2: 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

示例3: GetDemangledFunctionName

static IsoString GetDemangledFunctionName( const char* symbol, IsoString& addrStr )
{
   IsoString symbolStr( symbol );
   addrStr.Clear();

   // Get mangled function name. Example:
   //    /opt/PixInsight/bin/lib/libQtGui.so.4(_ZN7QWidget5eventEP6QEvent+0x411) [0x7fa271347811]
   StringList tokens;
   symbolStr.Break( tokens, '(' , true/*trim*/ );
   if ( tokens.Length() != 2 )
      return symbolStr;

   // Take second token and split again.
   StringList tokens2;
   tokens[1].Break( tokens2, '+' , true/*trim*/ );
   if ( tokens2.Length() != 2 )
      return symbolStr;

   // If there is no function name, do not set the addr string.
   if ( !tokens2[0].IsEmpty() )
   {
      addrStr = tokens2[1];
      addrStr.DeleteChar( '(' );
      addrStr.DeleteChar( ')' );
   }

   // The first token of tokens2 contains the mangled string. Demangle it.
   size_t funcnameSize = 256;
   char funcname[ funcnameSize ];
   int status;
   IsoString token( tokens2[0] );
   const char* demangledFuncname = abi::__cxa_demangle( token.c_str(), funcname, &funcnameSize, &status );
   return (status == 0) ? IsoString( demangledFuncname ) : symbolStr;
}
开发者ID:aleixpuig,项目名称:PCL,代码行数:34,代码来源:UnixSignalException.cpp

示例4: Purge

void FileDataCache::Purge() const
{
   IsoString key = m_keyPrefix;
   if ( key.EndsWith( '/' ) )
      key.DeleteRight( key.UpperBound() );
   Settings::Remove( key );
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:7,代码来源:FileDataCache.cpp

示例5: ToSource

String ProcessInstance::ToSource( const IsoString& language, const IsoString& varId, int indent ) const
{
   char16_type* s = (*API->Process->GetProcessInstanceSourceCode)(
                              ModuleHandle(), handle, language.c_str(), varId.c_str(), indent );
   if ( s == 0 )
      throw APIFunctionError( "GetProcessInstanceSourceCode" );
   String source( s );
   Module->Deallocate( s );
   return source;
}
开发者ID:morserover,项目名称:PCL,代码行数:10,代码来源:ProcessInstance.cpp

示例6: addElement

 void SwitchProperty::addElement(IsoString elementName, IsoString value){
 	 ISwitch* sp = ((ISwitchVectorProperty*) m_property->getProperty())->sp;
 	 int nsp = ((ISwitchVectorProperty*) m_property->getProperty())->nsp;
 	 sp = (ISwitch*) realloc(sp, (nsp+1) * sizeof(ISwitch));
 	 CHECK_POINTER(sp);
 	 strcpy(sp->name, elementName.c_str());
 	 sp->s = (strcmp(value.c_str(),"ON")==0) ? ISS_ON : ISS_OFF ;
 	 sp->svp =(ISwitchVectorProperty*) m_property->getProperty();
 	 ((ISwitchVectorProperty*) m_property->getProperty())->nsp++;
 	 ((ISwitchVectorProperty*) m_property->getProperty())->sp = sp;
  }
开发者ID:SunGong1993,项目名称:PCL,代码行数:11,代码来源:IINDIProperty.cpp

示例7: SetImageProperty

void FileFormatImplementation::SetImageProperty( const IsoString& id, const Variant& value )
{
   IsoString tid = id.Trimmed();
   if ( !tid.IsEmpty() && value.IsValid() )
   {
      FileFormatPropertyArray::iterator i = m_data->properties.Search( tid );
      if ( i != m_data->properties.End() )
         i->value = value;
      else
         m_data->properties.Append( FileFormatProperty( tid, value ) );
   }
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:12,代码来源:FileFormatImplementation.cpp

示例8: addElement

void TextProperty::addElement( IsoString elementName, IsoString value )
{
   ITextVectorProperty* tvp = m_property->getText();
   IText* tp = tvp->tp;
   int ntp = tvp->ntp;
   tp = reinterpret_cast<IText*>( realloc( tp, (ntp + 1)* sizeof( IText ) ) );
   if ( tp == nullptr )
      throw std::bad_alloc();
   strcpy( tp->name, elementName.c_str() );
   tp->text = value.Release(); // N.B.: Can do this because value is being passed by value, so we have a local copy.
   tp->tvp = tvp;
   tvp->ntp++;
   tvp->tp = tp;
}
开发者ID:eprimucci,项目名称:PCL,代码行数:14,代码来源:IINDIProperty.cpp

示例9: Error

ProcessParameter::ProcessParameter( const Process& process, const IsoString& paramId )
{
   m_data = new ProcessParameterPrivate( (*API->Process->GetParameterByName)( process.Handle(), paramId.c_str() ) );
   if ( m_data->handle == nullptr )
   {
      if ( paramId.IsEmpty() )
         throw Error( "ProcessParameter: Empty process parameter identifier specified" );
      if ( !paramId.IsValidIdentifier() )
         throw Error( "ProcessParameter: Invalid process parameter identifier specified: \'" + paramId + '\'' );

      throw Error( "ProcessParameter: No parameter was found "
                   "with the specified identifier \'" + paramId + "\' for process \'" + process.Id() + '\'' );
   }
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:14,代码来源:ProcessParameter.cpp

示例10: Properties

ImagePropertyDescriptionArray FileFormatInstance::Properties()
{
   ImagePropertyDescriptionArray properties;
   IsoString id;
   size_type len = 0;
   (*API->FileFormat->EnumerateImageProperties)( handle, 0, 0, &len, 0 ); // 1st call to get max identifier length
   if ( len > 0 )
   {
      id.Reserve( len );
      if ( (*API->FileFormat->EnumerateImageProperties)( handle, APIPropertyEnumerationCallback,
                                                         id.Begin(), &len, &properties ) == api_false )
         throw APIFunctionError( "EnumerateImageProperties" );
   }
   return properties;
}
开发者ID:aleixpuig,项目名称:PCL,代码行数:15,代码来源:FileFormatInstance.cpp

示例11: 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

示例12: 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

示例13: 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

示例14: vs

void MetaModule::GetVersion( int& major, int& minor, int& release, int& build,
                             IsoString& language, IsoString& status ) const
{
   // Set undefined states for all variables, in case of error.
   major = minor = release = build = 0;
   language.Clear();
   status.Clear();

   IsoString vs( Version() );

   // A version string must begin with a version marker
   if ( vs.Length() < LengthOfVersionMarker )
      return;

   // Split the string of version numbers into tokens separated by dots
   StringList tokens;
   vs.Break( tokens, '.', false/*trim*/, LengthOfVersionMarker );

   // Required: MM.mm.rr.bbbb.LLL
   // Optional: .<status>
   if ( tokens.Length() < 5 || tokens.Length() > 6 )
      return;

   // Extract version numbers
   try
   {
      int MM   = tokens[0].ToInt( 10 );
      int mm   = tokens[1].ToInt( 10 );
      int rr   = tokens[2].ToInt( 10 );
      int bbbb = tokens[3].ToInt( 10 );

      major = MM;
      minor = mm;
      release = rr;
      build = bbbb;
   }
   catch ( ... ) // silently eat all parse exceptions here
   {
      return;
   }

   // Language code
   language = tokens[4]; // ### TODO: Verify validity of ISO 639.2 code

   // Optional status word
   if ( tokens.Length() == 6 )
      status = tokens[5];  // ### TODO: Verify validity of the status word
}
开发者ID:aleixpuig,项目名称:PCL,代码行数:48,代码来源:MetaModule.cpp

示例15: ComputeProperty

Variant View::ComputeProperty( const IsoString& property, bool notify )
{
   api_property_value value;
   if ( (*API->View->ComputeViewProperty)( ModuleHandle(), handle, property.c_str(), notify, &value ) == api_false )
      throw APIFunctionError( "ComputeViewProperty" );
   return VariantFromAPIPropertyValue( value );
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:7,代码来源:View.cpp


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