Esempio n. 1
0
I_Field_Ptr CreateEnumField( 
	I_Table_Ptr 			inTable, 
	const String& 			inName,
	I_Type_Enumerated_Ptr 	inpType,
	vuint16					inFlags )
{
	I_PropertyContainer_Ptr props = new PropertyContainer();	

	props->Add( new Prop_EnumType(inpType) );

	// ---------------
	I_Field_Ptr pField;

	switch( inpType->get_MaxIdentCount() )
	{
		case ENUM_8_IDENT_COUNT:
		{
			pField = inTable->CreateField( inName, kTypeEnum8, inFlags, props );
		} break;

		case ENUM_16_IDENT_COUNT:
		{
			pField = inTable->CreateField( inName, kTypeEnum16, inFlags, props );
		} break;

		default:
		{
			FBL_Throw( xFeatureError( ERR_FEATURE_NOT_SUPPORTED, "Not enum8 or enum16" ) );
		}
	}
	

	return pField;
}
Esempio n. 2
0
I_Value* CreateValue_Enum( 
	I_Type_Enumerated_Ptr	inpType,
	vuint16 				inFlags,	
	bool					inIsRemote )
{
	FBL_CHECK( inpType );
	I_Value* pValue = nullptr;

	switch( inpType->get_MaxIdentCount() )
	{
		case ENUM_8_IDENT_COUNT:
		{
			pValue = (bool(inFlags & fNullable)) ? 
				new Value_enum_null8( inpType ) : new Value_enum8( inpType );
		} break;

		case ENUM_16_IDENT_COUNT:
		{
			pValue = (bool(inFlags & fNullable)) ? 
				new Value_enum_null16( inpType ) : new Value_enum16( inpType );
		} break;

		default:
		{
			FBL_Throw( xFeatureError( ERR_FEATURE_NOT_SUPPORTED, "Not enum8 or enum16" ) );
		}
	}			

	if( inIsRemote )
		pValue->put_IsRemote( inIsRemote );

	return pValue;
}
Esempio n. 3
0
// Finds the given position in the file, then writes a given buffer.
//
vuint32 FileWin::DoWrite( 
	const char* inBuffer, 
	flength		inFrom, 
	vuint32 		inHowMuch )
{
	mNeedFlush = true;
	
	DWORD Written;

	FBL_CHECK(inBuffer);

	if( mReadOnly )
		FBL_Throw(xOSFileError(ERR_OS_FILE_READ_ONLY));

	Seek(inFrom, begin);

	if (!::WriteFile(mHandle, inBuffer, inHowMuch, &Written, NULL))
		throw xOSFileError( (ERROR_TYPE) ::GetLastError() );

	return Written;
}