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 namespace Primavera
18 {
19 class PrimaveraProjectInfo;
20 } // namespace Primavera
21 class PrimaveraXerReader;
22 class PrimaveraXmlReader;
23 class Project;
24 } // namespace Tasks
25 } // namespace Aspose
26 namespace System
27 {
28 namespace Collections
29 {
30 namespace Generic
31 {
32 template <typename> class List;
33 } // namespace Generic
34 } // namespace Collections
35 namespace IO
36 {
37 class Stream;
38 } // namespace IO
39 } // namespace System
40 
41 namespace Aspose {
42 
43 namespace Tasks {
44 
45 /// <summary>
46 /// Represents a base reader which can be used to read Project UIDs from multi project Primavera XER or XML files.
47 /// </summary>
48 class ASPOSE_TASKS_SHARED_CLASS PrimaveraBaseReader : public System::Object
49 {
51  typedef System::Object BaseType;
52 
53  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
54  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
55 
58 
59 public:
60 
61  /// <summary>
62  /// Return a list of the projects' unique identifiers.
63  /// </summary>
64  /// <returns>List of projects' unique identifiers.</returns>
65  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::List<int32_t>> GetProjectUids();
66  /// <summary>
67  /// Return a list of the project's short info objects.
68  /// </summary>
69  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Primavera::PrimaveraProjectInfo>>> GetProjectInfos();
70  /// <summary>
71  /// Loads the project with the specified unique identifier.
72  /// </summary>
73  /// <param name="projectUid">Unique identifier of the project to load.</param>
74  /// <returns>Project with specified unique identifier from the specified multi project file. Null if project doesn't exist.</returns>
75  ASPOSE_TASKS_SHARED_API System::SharedPtr<Project> LoadProject(int32_t projectUid);
76 
77 protected:
78 
79  /// <summary>
80  /// Initializes a new instance of the <see cref="PrimaveraBaseReader"></see> class.
81  /// </summary>
82  /// <param name="filePath">Path to file where Primavera project or projects are located.</param>
83  ASPOSE_TASKS_SHARED_API PrimaveraBaseReader(const System::String& filePath);
84  /// <summary>
85  /// Initializes a new instance of the <see cref="PrimaveraBaseReader"></see> class.
86  /// </summary>
87  /// <param name="stream">Stream with Primavera projects.</param>
88  ASPOSE_TASKS_SHARED_API PrimaveraBaseReader(const System::SharedPtr<System::IO::Stream>& stream);
89 
90  /// <summary>
91  /// Reads multi project data from the provided stream.
92  /// </summary>
93  virtual ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Primavera::PrimaveraProjectInfo>>> LoadFromStream(System::SharedPtr<System::IO::Stream> stream) = 0;
94  #ifdef ASPOSE_GET_SHARED_MEMBERS
95  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
96  #endif
97 
98 
99 private:
100 
101  System::String filePath;
102  System::SharedPtr<System::IO::Stream> stream;
103  int64_t streamInitialPosition;
104  bool initialized;
105  System::SharedPtr<System::Collections::Generic::List<int32_t>> pr_ProjectUids;
106 
107  const System::SharedPtr<System::Collections::Generic::List<int32_t>>& get_ProjectUids() const;
108  void set_ProjectUids(const System::SharedPtr<System::Collections::Generic::List<int32_t>>& value);
109 
110  System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Primavera::PrimaveraProjectInfo>>> pr_ProjectInfos;
111 
112  const System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Primavera::PrimaveraProjectInfo>>>& get_ProjectInfos() const;
113  void set_ProjectInfos(const System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Primavera::PrimaveraProjectInfo>>>& value);
114 
116 
117  void Initialize();
118  void InitProjectUids();
119 
120 };
121 
122 } // namespace Tasks
123 } // namespace Aspose
124 
125 
Represents a base reader which can be used to read Project UIDs from multi project Primavera XER or X...
Definition: PrimaveraBaseReader.h:49
System::SharedPtr< System::Collections::Generic::List< int32_t > > GetProjectUids()
Return a list of the projects' unique identifiers.
System::SharedPtr< System::Collections::Generic::List< System::SharedPtr< Primavera::PrimaveraProjectInfo > > > GetProjectInfos()
Return a list of the project's short info objects.
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:45
Represents a reader which allows to retrieve Project UIDs from Primavera Xml file.
Definition: PrimaveraXmlReader.h:45
Definition: Asn.h:13