Aspose.Tasks for C++
PrimaveraBaseReader.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="PrimaveraBaseReader.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/string.h>
9 #include <cstdint>
10 
11 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
12 
13 namespace Aspose
14 {
15 namespace Tasks
16 {
17 class PrimaveraXerReader;
18 class PrimaveraXmlReader;
19 class Project;
20 } // namespace Tasks
21 } // namespace Aspose
22 namespace System
23 {
24 namespace Collections
25 {
26 namespace Generic
27 {
28 template <typename> class List;
29 } // namespace Generic
30 } // namespace Collections
31 namespace IO
32 {
33 class Stream;
34 } // namespace IO
35 } // namespace System
36 
37 namespace Aspose {
38 
39 namespace Tasks {
40 
41 /// <summary>
42 /// Represents a base reader which can be used to read Project UIDs from multi project Primavera XER or XML files.
43 /// </summary>
44 class ASPOSE_TASKS_SHARED_CLASS PrimaveraBaseReader : public System::Object
45 {
47  typedef System::Object BaseType;
48 
49  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
50  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
51 
54 
55 public:
56 
57  /// <summary>
58  /// Return a list of the projects' unique identifiers.
59  /// </summary>
60  /// <returns>List of projects' unique identifiers.</returns>
61  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::List<int32_t>> GetProjectUids();
62  /// <summary>
63  /// Loads the project with the specified unique identifier.
64  /// </summary>
65  /// <param name="projectUid">Unique identifier of the project to load.</param>
66  /// <returns>Project with specified unique identifier from the specified multi project file. Null if project doesn't exist.</returns>
67  ASPOSE_TASKS_SHARED_API System::SharedPtr<Project> LoadProject(int32_t projectUid);
68 
69 protected:
70 
71  /// <summary>
72  /// Initializes a new instance of the <see cref="PrimaveraBaseReader"></see> class.
73  /// </summary>
74  /// <param name="filePath">Path to file where Primavera project or projects are located.</param>
75  ASPOSE_TASKS_SHARED_API PrimaveraBaseReader(const System::String& filePath);
76  /// <summary>
77  /// Initializes a new instance of the <see cref="PrimaveraBaseReader"></see> class.
78  /// </summary>
79  /// <param name="stream">Stream with Primavera projects.</param>
80  ASPOSE_TASKS_SHARED_API PrimaveraBaseReader(const System::SharedPtr<System::IO::Stream>& stream);
81 
82  /// <summary>
83  /// Reads multi project data from the provided stream.
84  /// </summary>
85  virtual ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::List<int32_t>> LoadFromStream(System::SharedPtr<System::IO::Stream> stream) = 0;
86  #ifdef ASPOSE_GET_SHARED_MEMBERS
87  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
88  #endif
89 
90 
91 private:
92 
93  System::String filePath;
94  System::SharedPtr<System::IO::Stream> stream;
95  int64_t streamInitialPosition;
96  bool initialized;
97  System::SharedPtr<System::Collections::Generic::List<int32_t>> pr_ProjectUids;
98 
99  const System::SharedPtr<System::Collections::Generic::List<int32_t>>& get_ProjectUids() const;
100  void set_ProjectUids(const System::SharedPtr<System::Collections::Generic::List<int32_t>>& value);
101 
103 
104  void Initialize();
105 
106 };
107 
108 } // namespace Tasks
109 } // namespace Aspose
110 
111 
Represents a base reader which can be used to read Project UIDs from multi project Primavera XER or X...
Definition: PrimaveraBaseReader.h:45
System::SharedPtr< System::Collections::Generic::List< int32_t > > GetProjectUids()
Return a list of the projects' unique identifiers.
System::SharedPtr< Project > LoadProject(int32_t projectUid)
Loads the project with the specified unique identifier.
Represents a reader to read Project UIDs from Primavera XER file
Definition: PrimaveraXerReader.h:35
Represents a reader which allows to retrieve Project UIDs from Primavera Xml file.
Definition: PrimaveraXmlReader.h:35
Definition: Asn.h:13