Database.h
1 //##################################################################################################
2 //
3 // Ceetron Export
4 // Component: VTFx
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2015, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeeVTFx/Base.h"
16 #include "CeeVTFx/Block.h"
17 
18 #include "CeeCore/RefCountedObject.h"
19 #include "CeeCore/Str.h"
20 #include "CeeCore/PtrRef.h"
21 
22 namespace cee {
23 namespace vtfx {
24 
25 class File;
26 
27 //==================================================================================================
28 //
29 //
30 //
31 //==================================================================================================
32 class CEE_VTFX_EXPORT Database : public RefCountedObject
33 {
34 public:
35  Database(File* file, const Str& databaseName, int databaseId);
36  virtual ~Database();
37 
38  int id() const;
39  Str name() const;
40 
41  bool writeBlock(const Block* block);
42 
43  size_t blockCount(Block::BlockType blockType) const;
44  PtrRef<Block> blockByIndex(Block::BlockType blockType, size_t blockIndex);
45  PtrRef<Block> blockById(Block::BlockType blockType, int blockId);
46 
47 private:
48  Database(File* file, int databaseId);
49  bool internal_parse();
50 
51 private:
52  friend class FilePrivate;
53  friend class File;
54 
55  CEE_PRIVATE_IMPL(Database);
56  CEE_DISALLOW_COPY_AND_ASSIGN(Database);
57 };
58 
59 }
60 }
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppLogging.cpp:20
A VTFx file.
Definition: File.h:35
A VTFx database. The class represents a database of data blocks.
Definition: Database.h:32
A general unicode based string class.
Definition: Str.h:28
Smart pointer class used for handling reference counted objects (that derive from Object)...
Definition: PtrRef.h:26
BlockType
Global block type constants used by Ceetron Export. Normally users do not need these, except for some methods of TransformationResultValuesBlock.
Definition: Block.h:35
Base class for all reference counted objects with built-in support for intrusive reference counting...
Definition: RefCountedObject.h:34
Abstract base class for all VTFx blocks.
Definition: Block.h:29