Beispiel #1
0
void XsiExp::WriteConfig()
{
	TSTR filename = GetCfgFilename();
	FILE* cfgStream;

	cfgStream = fopen(filename, "wb");
	if (!cfgStream)
  {
		return;
  }

	// Write CFG version
	_putw(CFG_VERSION,				cfgStream);

	fputc(GetIncludeAnim(),			cfgStream);
	fputc(GetIncludeVertexColors(),	cfgStream);

	fputc(GetAlwaysSample(),		cfgStream);
	_putw(GetMeshFrameStep(),		cfgStream);
	_putw(GetKeyFrameStep(),		cfgStream);

  _putw(GetPrecision(),			cfgStream);

	fclose(cfgStream);
}
Beispiel #2
0
//============================================================================
//		NCFNumber::GetObject : Get the object.
//----------------------------------------------------------------------------
NCFObject NCFNumber::GetObject(void) const
{	float64_t		valueFloat64;
	float32_t		valueFloat32;
	int64_t			valueInt64;
	NCFObject		theObject;



	// Get the object
	switch (GetPrecision()) {
		case kNPrecisionInt8:
		case kNPrecisionInt16:
		case kNPrecisionInt32:
		case kNPrecisionInt64:
			valueInt64 = GetInt64();
			theObject.SetObject(CFNumberCreate(kCFAllocatorNano, kCFNumberLongLongType, &valueInt64));
			break;
		
		case kNPrecisionFloat32:
			valueFloat32 = GetFloat32();
			theObject.SetObject(CFNumberCreate(kCFAllocatorNano, kCFNumberFloatType,    &valueFloat32));
			break;
		
		case kNPrecisionFloat64:
			valueFloat64 = GetFloat64();
			theObject.SetObject(CFNumberCreate(kCFAllocatorNano, kCFNumberDoubleType,   &valueFloat64));
			break;
		
		default:
			NN_LOG("Unable to convert '%@' to CFNumber", GetString());
			break;
		}

	return(theObject);
}
	String CDatabaseConnectionMySql::DoWriteFloat( float value ) const
	{
		StringStream stream;
		uint32_t decimals = GetPrecision( EFieldType_FLOAT32 );
		stream << STR( "CAST( " );
		stream.precision( decimals * 2 );
		stream << value;
		// float min == -3.40282e+038 => 39 digits before decimals separator
		stream << STR( " AS DECIMAL( " ) << ( 39 + decimals ) << STR( ", " ) << decimals << STR( " ) )" );
		return stream.str();
	}
Beispiel #4
0
void AscOut::WriteConfig()
{
	TSTR filename = GetCfgFilename();
	FILE* cfgStream;

	cfgStream = fopen(filename, "wb");
	if (!cfgStream)
		return;

	// Write CFG version
	_putw(CFG_VERSION,				cfgStream);

	_putw(GetPrecision(),			cfgStream);

	fclose(cfgStream);
}
Beispiel #5
0
bool COLBLK::InitValue(PGLOBAL g)
  {
  if (Value)
    return false;                       // Already done

  // Unsigned can be set only for valid value types
  int prec = (Unsigned) ? 1 : GetPrecision();

  // Allocate a Value object
  if (!(Value = AllocateValue(g, Buf_Type, Format.Length,
                                 prec, GetDomain())))
    return true;

  AddStatus(BUF_READY);
  Value->SetNullable(Nullable);

#ifdef DEBTRACE
 htrc(" colp=%p type=%d value=%p coluse=%.4X status=%.4X\n",
  this, Buf_Type, Value, ColUse, Status);
#endif

  return false;
  } // end of InitValue