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


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

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


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

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

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

示例3: PropertyAttributes

ViewPropertyAttributes View::PropertyAttributes( const IsoString& property ) const
{
   uint32 flags = 0;
   if ( (*API->View->GetViewPropertyAttributes)( ModuleHandle(), handle, property.c_str(), &flags, 0/*type*/ ) == api_false )
      throw APIFunctionError( "GetViewPropertyAttributes" );
   return ViewPropertyAttributes( ViewPropertyAttribute::mask_type( flags ) );
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:7,代码来源:View.cpp

示例4: PropertyType

Variant::data_type View::PropertyType( const IsoString& property ) const
{
   uint64 type = 0;
   if ( (*API->View->GetViewPropertyAttributes)( ModuleHandle(), handle, property.c_str(), 0/*flags*/, &type ) == api_false )
      throw APIFunctionError( "GetViewPropertyAttributes" );
   return VariantTypeFromAPIPropertyType( type );
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:7,代码来源:View.cpp

示例5: SetPropertyValue

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

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

示例7: PropertyValue

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

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

示例9: WriteProperty

bool FileFormatInstance::WriteProperty( const IsoString& property, const Variant& value )
{
   try
   {
      if ( (*API->FileFormat->BeginPropertyEmbedding)( handle ) == api_false )
         return false;

      bool ok = true;

      if ( value.IsValid() )
      {
         api_property_value apiValue;
         APIPropertyValueFromVariant( apiValue, value );
         api_property_value safeCopy = apiValue;
         ok = (*API->FileFormat->SetImageProperty)( handle, property.c_str(), &safeCopy ) != api_false;

         if ( safeCopy.data.blockValue != apiValue.data.blockValue ||
              safeCopy.dimX != apiValue.dimX || safeCopy.dimY != apiValue.dimY ||
              safeCopy.dimZ != apiValue.dimZ || safeCopy.dimT != apiValue.dimT || safeCopy.type != apiValue.type )
         {
            APIHackingAttempt( "WriteProperty" );
         }
      }

      (*API->FileFormat->EndPropertyEmbedding)( handle );

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

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

示例11: getFormattedNumber

String PropertyUtils::getFormattedNumber( String numberStr, IsoString numberFormat )
{
   if ( numberStr.IsEmpty() )
      return numberStr;

   size_t im = numberFormat.Find( 'm' );
   if ( im == String::notFound )
      return String().Format( numberFormat.c_str(), stringToFloatSafe( numberStr ) );

   numberFormat.DeleteRight( im );
   numberFormat.DeleteLeft( 1 );
   StringList tokens;
   numberFormat.Break( tokens, '.', true/*trim*/ );
   size_t fraction = stringToIntSafe( tokens[1] );
   size_t width    = stringToIntSafe( tokens[0] ) - fraction;
   assert( width > 0 );
   int hours = Trunc( stringToFloatSafe( numberStr ) );
   switch ( fraction )
   {
   case 3:
      {
         int minutes = Trunc( (stringToFloatSafe( numberStr ) - hours)*60 );
         IsoString formatStr = '%' + IsoString().Format( "%dd",width ) + ":%02d";
         return String().Format( formatStr.c_str(), hours, Abs( minutes ) );
      }
   case 5:
      {
         int minutes     = Trunc( (stringToFloatSafe( numberStr ) - hours)*60 );
         int minutesfrac = Trunc( ((stringToFloatSafe( numberStr ) - hours)*60 - minutes)*10);
         IsoString formatStr = '%' + IsoString().Format( "%dd", width ) + ":%02d.%d";
         return String().Format( formatStr.c_str(), hours, Abs( minutes ), Abs( minutesfrac ) );
      }
   case 6:
      {
         int minutes     = Trunc( (stringToFloatSafe( numberStr ) - hours)*60 );
         int seconds     = Trunc( ((stringToFloatSafe( numberStr ) - hours)*60 - minutes)*60 );
         IsoString formatStr = '%' + IsoString().Format( "%dd", width ) + ":%02d:%02d";
         return String().Format( formatStr.c_str(), hours, Abs( minutes ), Abs( seconds ) );
      }
   case 8:
      {
         int minutes     = Trunc( (stringToFloatSafe( numberStr ) - hours)*60 );
         int seconds     = Trunc( ((stringToFloatSafe( numberStr ) - hours)*60 - minutes)*60 );
         int secondsfrac = Trunc( (((stringToFloatSafe( numberStr ) - hours)*60 - minutes)*60 - seconds)*10 );
         IsoString formatStr = '%' + IsoString().Format( "%dd", width ) + ":%02d:%02d.%d";
         return String().Format( formatStr.c_str(), hours, Abs( minutes ), Abs( seconds ), Abs( secondsfrac ) );
      }
   case 9:
      {
         int minutes     = Trunc( (stringToFloatSafe( numberStr ) - hours)*60 );
         int seconds     = Trunc( ((stringToFloatSafe( numberStr ) - hours)*60 - minutes)*60 );
         int secondsfrac = Trunc( (((stringToFloatSafe( numberStr ) - hours)*60 - minutes)*60 - seconds)*100 );
         IsoString formatStr = '%' + IsoString().Format( "%dd", width ) + ":%02d:%02d.%02d";
         return String().Format( formatStr.c_str(), hours, Abs( minutes ), Abs( seconds ), Abs( secondsfrac ) );
      }
   default:
      return String();
   }
}
开发者ID:eprimucci,项目名称:PCL,代码行数:59,代码来源:PropertyNode.cpp

示例12: addElement

void SwitchProperty::addElement( IsoString elementName, IsoString value )
{
   ISwitchVectorProperty* svp = m_property->getSwitch();
   ISwitch* sp = svp->sp;
   int nsp = svp->nsp;
   sp = reinterpret_cast<ISwitch*>( realloc( sp, (nsp + 1)*sizeof( ISwitch ) ) );
   if ( sp == nullptr )
      throw std::bad_alloc();
   strcpy( sp->name, elementName.c_str() );
   sp->s = (value == "ON") ? ISS_ON : ISS_OFF;
   sp->svp = svp;
   svp->nsp++;
   svp->sp = sp;
}
开发者ID:eprimucci,项目名称:PCL,代码行数:14,代码来源:IINDIProperty.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: 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

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


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