Aspose.Tasks for C++
DayTypeCollection.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="DayTypeCollection.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/collections/ilist.h>
9 #include <system/array.h>
10 #include <cstdint>
11 
12 #include "aspose.tasks.cpp/Enums/DayType.h"
13 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
14 
15 namespace Aspose
16 {
17 namespace Tasks
18 {
19 class CalendarException;
20 namespace IO
21 {
22 namespace Html
23 {
24 class HtmlReadingUtils;
25 } // namespace Html
26 namespace MSProject
27 {
28 class Mpp12CalendarWriter;
29 class Mpp12ExceptionReader;
30 } // namespace MSProject
31 namespace Xml
32 {
33 class ExceptionNodeReader;
34 class ExceptionNodeWriter;
35 } // namespace Xml
36 } // namespace IO
37 } // namespace Tasks
38 } // namespace Aspose
39 namespace System
40 {
41 namespace Collections
42 {
43 namespace Generic
44 {
45 template <typename, typename> class Dictionary;
46 template <typename> class IEnumerator;
47 } // namespace Generic
48 } // namespace Collections
49 } // namespace System
50 
51 namespace Aspose {
52 
53 namespace Tasks {
54 
55 /// <summary>
56 /// Represents a collection of <see cref="DayType"></see> objects.
57 /// </summary>
58 class ASPOSE_TASKS_SHARED_CLASS DayTypeCollection : public System::Collections::Generic::IList<Aspose::Tasks::DayType>
59 {
61  typedef System::Collections::Generic::IList<Aspose::Tasks::DayType> BaseType;
62 
63  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
64  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
65 
67  friend class Aspose::Tasks::IO::Html::HtmlReadingUtils;
68  friend class Aspose::Tasks::IO::MSProject::Mpp12ExceptionReader;
69  friend class Aspose::Tasks::IO::MSProject::Mpp12CalendarWriter;
70  friend class Aspose::Tasks::IO::Xml::ExceptionNodeReader;
71  friend class Aspose::Tasks::IO::Xml::ExceptionNodeWriter;
72 
73 public:
74 
75  /// <summary>
76  /// Gets the number of elements contained in this collection.
77  /// </summary>
78  ASPOSE_TASKS_SHARED_API int32_t get_Count() const override;
79  /// <summary>
80  /// Gets a value indicating whether if this collection is read-only; otherwise, false.
81  /// </summary>
82  ASPOSE_TASKS_SHARED_API bool get_IsReadOnly() const override;
83 
84  /// <summary>
85  /// Returns the element at the specified index.
86  /// </summary>
87  /// <param name="index">The zero-based index of the element to get or set.</param>
88  /// <returns>the element at the specified index.</returns>
89  ASPOSE_TASKS_SHARED_API DayType idx_get(int32_t index) const override;
90  /// <summary>
91  /// Sets the element at the specified index.
92  /// </summary>
93  /// <param name="index">The zero-based index of the element to get or set.</param>
94  /// <param name="value">the element at the specified index.</param>
95  ASPOSE_TASKS_SHARED_API void idx_set(int32_t index, DayType value) override;
96 
97  /// <summary>
98  /// Returns an enumerator for this collection.
99  /// </summary>
100  /// <returns>an enumerator for this collection.</returns>
101  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::IEnumerator<DayType>> GetEnumerator() override;
102  /// <summary>
103  /// Adds the specified item to this collection.
104  /// </summary>
105  /// <param name="item">the specified item to add to this collection.</param>
106  ASPOSE_TASKS_SHARED_API void Add(const DayType& item) override;
107  /// <summary>
108  /// Removes all items from this collection.
109  /// </summary>
110  ASPOSE_TASKS_SHARED_API void Clear() override;
111  /// <summary>
112  /// Returns true if the specified item is found in this collection; otherwise, false.
113  /// </summary>
114  /// <param name="item">the specified item to find.</param>
115  /// <returns>true if the specified item is found in this collection; otherwise, false.</returns>
116  ASPOSE_TASKS_SHARED_API bool Contains(const DayType& item) const override;
117  /// <summary>
118  /// Copies the elements of this collection to the specified array, starting at the specified array index.
119  /// </summary>
120  /// <param name="array">the specified one-dimensional array to copy elements to</param>
121  /// <param name="arrayIndex">the zero-based index of the specified array at which copying begins.</param>
122  ASPOSE_TASKS_SHARED_API void CopyTo(System::ArrayPtr<DayType> array, int32_t arrayIndex) override;
123  /// <summary>
124  /// Removes the first occurrence of a specific object from this collection.
125  /// </summary>
126  /// <param name="item">the specified object to remove.</param>
127  /// <returns>true if the specified object was successfully removed from this collection; otherwise, false.</returns>
128  ASPOSE_TASKS_SHARED_API bool Remove(const DayType& item) override;
129  /// <summary>
130  /// Determines the index of the specified item in this collection.
131  /// </summary>
132  /// <param name="item">the specified item to locate in this collection.</param>
133  /// <returns>the index of the specified item if found; otherwise, -1.</returns>
134  ASPOSE_TASKS_SHARED_API int32_t IndexOf(const DayType& item) const override;
135  /// <summary>
136  /// Inserts the specified item at the specified index.
137  /// </summary>
138  /// <param name="index">the specified zero-based index at which the item should be inserted.</param>
139  /// <param name="item">the specified item to insert to this collection.</param>
140  ASPOSE_TASKS_SHARED_API void Insert(int32_t index, const DayType& item) override;
141  /// <summary>
142  /// Removes an item at the specified index.
143  /// </summary>
144  /// <param name="index">the specified zero-based index to remove an item at.</param>
145  ASPOSE_TASKS_SHARED_API void RemoveAt(int32_t index) override;
146 
147 protected:
148 
149  ASPOSE_TASKS_SHARED_API DayTypeCollection();
150 
151  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(DayTypeCollection, CODEPORTING_ARGS());
152 
153  ASPOSE_TASKS_SHARED_API DayTypeCollection(int32_t val);
154 
155  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(DayTypeCollection, CODEPORTING_ARGS(int32_t val));
156  ASPOSE_TASKS_SHARED_API int32_t Pack();
157 
158  virtual ASPOSE_TASKS_SHARED_API ~DayTypeCollection();
159 
160  #ifdef ASPOSE_GET_SHARED_MEMBERS
161  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
162  #endif
163 
164 
165 private:
166 
167  static System::SharedPtr<System::Collections::Generic::Dictionary<int32_t, DayType>>& DaysOfWeekTypes();
168 
169  System::SharedPtr<System::Collections::Generic::IList<DayType>> days;
170 
171  static System::SharedPtr<System::Collections::Generic::Dictionary<int32_t, DayType>> InitDaysOfWeekTable();
172  System::SharedPtr<System::Collections::Generic::IList<DayType>> ToDays(int32_t val);
173 
174 };
175 
176 } // namespace Tasks
177 } // namespace Aspose
178 
179 
Represent exceptional time periods in a calendar.
Definition: CalendarException.h:73
Represents a collection of DayType objects.
Definition: DayTypeCollection.h:59
DayType idx_get(int32_t index) const override
Returns the element at the specified index.
bool Contains(const DayType &item) const override
Returns true if the specified item is found in this collection; otherwise, false.
void Clear() override
Removes all items from this collection.
void Add(const DayType &item) override
Adds the specified item to this collection.
void Insert(int32_t index, const DayType &item) override
Inserts the specified item at the specified index.
bool Remove(const DayType &item) override
Removes the first occurrence of a specific object from this collection.
int32_t IndexOf(const DayType &item) const override
Determines the index of the specified item in this collection.
bool get_IsReadOnly() const override
Gets a value indicating whether if this collection is read-only; otherwise, false.
System::SharedPtr< System::Collections::Generic::IEnumerator< DayType > > GetEnumerator() override
Returns an enumerator for this collection.
void CopyTo(System::ArrayPtr< DayType > array, int32_t arrayIndex) override
Copies the elements of this collection to the specified array, starting at the specified array index.
void idx_set(int32_t index, DayType value) override
Sets the element at the specified index.
void RemoveAt(int32_t index) override
Removes an item at the specified index.
int32_t get_Count() const override
Gets the number of elements contained in this collection.
Definition: Asn.h:13