VTFxFileBrowser.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: UnstructGrid
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2011, 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 "CeeUnstructGrid/Base.h"
16 #include "CeeCore/PtrRef.h"
17 #include "CeeCore/Str.h"
18 #include "CeeCore/PropertySet.h"
19 
20 class VTDatabase;
21 
22 namespace cee {
23 
24 class Image;
25 
26 namespace ug {
27 
28 class VTFxMemoryFile;
29 
30 //==================================================================================================
31 //
32 //
33 //
34 //==================================================================================================
35 class CEE_UG_EXPORT VTFxFileBrowser
36 {
37 public:
39  ~VTFxFileBrowser();
40 
41  static bool isVTFxFile(const Str& fileName);
42  static bool isEncrypted(const Str& fileName);
43 
44  bool initialize(const Str& fileName);
45  bool initialize(const VTFxMemoryFile* vtfxMemFile);
46 
47  void setPassword(const Str& password);
48 
49  size_t caseCount() const;
50  Str caseName(size_t caseIndex) const;
51  Str caseDescriptionHtml(size_t caseIndex) const;
52  Image* caseSnapshot(size_t caseIndex) const;
53  int caseId(size_t caseIndex) const;
54  size_t caseIndex(int caseId) const;
55 
56  Str readTextFile(const Str& filename) const;
57 
58  size_t userTextFileCount() const;
59  Str userTextFileName(size_t userTextFileIndex) const;
60  Str userTextFileContent(size_t userTextFileIndex) const;
61 
62  int vendorId() const;
63  bool hasValidExpressSignature(const Str& vendorCode) const;
64  bool isPasswordValid() const;
65  bool isLegacyFile() const;
66 
67  bool fileInfo(PropertySet* properties);
68 
69 private:
70  CEE_PRIVATE_IMPL(VTFxFileBrowser);
71  CEE_DISALLOW_COPY_AND_ASSIGN(VTFxFileBrowser);
72 };
73 
74 } // namespace ug
75 } // namespace cee
Stores an RGBA image with 8 bits per pixel.
Definition: Image.h:25
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
A VTFx model file existing in memory.
Definition: VTFxMemoryFile.h:31
A general unicode based string class.
Definition: Str.h:28
A property set stores a set of properties each consisting of a key and a value.
Definition: PropertySet.h:28
Helper class that allows you to read case metadata from a VTFx file.
Definition: VTFxFileBrowser.h:35