Remove unused directories and files in video_in_hal
[staging/basesystem.git] / service / native / framework_unified / client / include / native_service / ns_version_if.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 //////////////////////////////////////////////////////////////////////////////////////////////////
19 /// \brief    Header for CFrameworkunifiedVersion class
20 //////////////////////////////////////////////////////////////////////////////////////////////////
21
22 /**
23  * @file ns_version_if.h
24 * @brief \~english Header for CFrameworkunifiedVersion class
25  */
26
27 #ifndef NS_NATIVESERVICES_INC_NATIVE_NS_VERSION_IF_H_  // NOLINT  (build/header_guard)
28 #define NS_NATIVESERVICES_INC_NATIVE_NS_VERSION_IF_H_
29 #include <native_service/frameworkunified_types.h>
30 #include <string.h>
31
32 #ifdef AGL_STUB
33 #include <other_service/strlcpy.h>
34 #include <other_service/strlcat.h>
35 #endif
36
37
38
39 /** @addtogroup BaseSystem
40  *  @{
41  */
42 /** @addtogroup native_service
43  *  @ingroup BaseSystem
44  *  @{
45  */
46 /** @addtogroup framework_unified
47  *  @ingroup native_service
48  *  @{
49  */
50 /** @addtogroup native
51  *  @ingroup framework_unified
52  *  @{
53  */
54
55 /**
56  * @class CFrameworkunifiedVersion
57  * @brief \~english Version Info Class
58  * @par   \~english Brief Introduction
59  * \~english This class provides functions to get various information of the version.
60  *
61  */
62 class CFrameworkunifiedVersion {
63  public:
64   ////////////////////////////////////////////////////////////////////////////////////////////////
65   /// \ingroup NS_UtilityCenter
66   /// \~english @par Brief
67   ///       Construct a CFrameworkunifiedVersion object.
68   /// \~english @par Prerequisite
69   ///       - None
70   /// \~english @par Change of internal state
71   ///       - None
72   /// \~english @par Conditions of processing failure
73   ///       - None
74   /// \~english @par Classification
75   ///       Public
76   /// \~english @par Type
77   ///       Sync Only
78   /// \~english @par Detail
79   ///       The function constructs a CFrameworkunifiedVersion object.
80   /// \~english @see ~CFrameworkunifiedVersion
81   ////////////////////////////////////////////////////////////////////////////////////////////////
82   CFrameworkunifiedVersion();
83
84   ///////////////////////////////////////////////////////////////////////////////////////////////
85   /// \ingroup NS_UtilityCenter
86   /// \~english @par Brief
87   ///        Constructs a CFrameworkunifiedVersion object with parameters.
88   /// \~english @param[in] major
89   ///        UI_16 - Major number of the application
90   /// \~english @param[in] minor
91   ///        UI_16 - Minor number of the application
92   /// \~english @param[in] revision
93   ///        UI_16 - Revision number of the application
94   /// \~english @par Prerequisite
95   ///       - None
96   /// \~english @par Change of internal state
97   ///       - None
98   /// \~english @par Conditions of processing failure
99   ///       - None
100   /// \~english @par Classification
101   ///       Public
102   /// \~english @par Type
103   ///       Sync Only
104   /// \~english @par Detail
105   ///       The function constructs a CFrameworkunifiedVersion object with parameters.
106   /// \~english @see ~CFrameworkunifiedVersion
107   ////////////////////////////////////////////////////////////////////////////////////////////////
108   CFrameworkunifiedVersion(UI_16 major, UI_16 minor, UI_16 revision);
109
110   ////////////////////////////////////////////////////////////////////////////////////////////////
111   /// \ingroup NS_UtilityCenter
112   /// \~english @par Brief
113   ///       Destruct the CFrameworkunifiedVersion object.
114   /// \~english @par Prerequisite
115   ///       - None
116   /// \~english @par Change of internal state
117   ///       - None
118   /// \~english @par Conditions of processing failure
119   ///       - None
120   /// \~english @par Classification
121   ///       Public
122   /// \~english @par Type
123   ///       Sync Only
124   /// \~english @par Detail
125   ///       The function destructs the CFrameworkunifiedVersion object.
126   /// \~english @see CFrameworkunifiedVersion
127   ////////////////////////////////////////////////////////////////////////////////////////////////
128   virtual ~CFrameworkunifiedVersion();
129
130   ////////////////////////////////////////////////////////////////////////////////////////////////
131   /// \ingroup NS_UtilityCenter
132   /// \~english @par Brief
133   ///       Get the data number
134   /// \~english @param [in] a
135   ///       CFrameworkunifiedVersion - the CFrameworkunifiedVersion object that will be compared against b.
136   /// \~english @param [in] b
137   ///       CFrameworkunifiedVersion - the CFrameworkunifiedVersion object that will be compared against a.
138   /// \~english @retval TRUE: Match, FALSE: Does not Match
139   ///
140   /// \~english @par Prerequisite
141   ///       - None
142   /// \~english @par Change of internal state
143   ///       - None
144   /// \~english @par Conditions of processing failure
145   ///       - None
146   /// \~english @par Classification
147   ///       Public
148   /// \~english @par Type
149   ///       Sync Only
150   /// \~english @par Detail
151   ///       The function is a friend function of the class. \n
152   ///       The function checks whether the object matchs the other or not. Match: returns TRUE, \n
153   ///       Does not match: returns FALSE.
154   /// \~english @see operator ==
155   ////////////////////////////////////////////////////////////////////////////////////////////////
156   friend BOOL operator == (CFrameworkunifiedVersion &a, CFrameworkunifiedVersion &b);  // NOLINT (readability/nolint)
157
158   ////////////////////////////////////////////////////////////////////////////////////////////////
159   /// \ingroup NS_UtilityCenter
160   /// \~english @par Brief
161   ///       Get the data number
162   /// \~english @param [in] f_test_i
163   ///       CFrameworkunifiedVersion - the CFrameworkunifiedVersion object that will be compared against this obj.
164   /// \~english @retval TRUE: Match, FALSE: Does not Match
165   ///
166   /// \~english @par Prerequisite
167   ///       - None
168   /// \~english @par Change of internal state
169   ///       - None
170   /// \~english @par Conditions of processing failure
171   ///       - None
172   /// \~english @par Classification
173   ///       Public
174   /// \~english @par Type
175   ///       Sync Only
176   /// \~english @par Detail
177   ///       The function checks whether the object matchs the other or not. Match: returns TRUE, \n
178   ///       Does not match: returns FALSE.
179   /// \~english @see
180   ////////////////////////////////////////////////////////////////////////////////////////////////
181   BOOL operator == (const CFrameworkunifiedVersion &f_test_i); // NOLINT (readability/nolint)
182
183   ////////////////////////////////////////////////////////////////////////////////////////////////
184   /// \ingroup NS_UtilityCenter
185   /// \~english @par Brief
186   ///       Get the version as string
187   /// \~english @retval the vision string
188   ///
189   /// \~english @par Prerequisite
190   ///       - None
191   /// \~english @par Change of internal state
192   ///       - None
193   /// \~english @par Conditions of processing failure
194   ///       - None
195   /// \~english @par Classification
196   ///       Public
197   /// \~english @par Type
198   ///       Sync Only
199   /// \~english @par Detail
200   ///       The function returns the version string.
201   /// \~english @see
202   ////////////////////////////////////////////////////////////////////////////////////////////////
203   PCSTR VersionStr();
204
205   ////////////////////////////////////////////////////////////////////////////////////////////////
206   /// \ingroup NS_UtilityCenter
207   /// \~english @par Brief
208   ///       Get the date as string
209   /// \~english @retval the date string
210   ///
211   /// \~english @par Prerequisite
212   ///       - None
213   /// \~english @par Change of internal state
214   ///       - None
215   /// \~english @par Conditions of processing failure
216   ///       - None
217   /// \~english @par Classification
218   ///       Public
219   /// \~english @par Type
220   ///       Sync Only
221   /// \~english @par Detail
222   ///       The function returns the date when building.
223   /// \~english @see
224   ////////////////////////////////////////////////////////////////////////////////////////////////
225   PCSTR DateStr();
226
227   ////////////////////////////////////////////////////////////////////////////////////////////////
228   /// \ingroup NS_UtilityCenter
229   /// \~english @par Brief
230   ///       Get the signature number
231   /// \~english @retval the signature
232   ///
233   /// \~english @par Prerequisite
234   ///       - None
235   /// \~english @par Change of internal state
236   ///       - None
237   /// \~english @par Conditions of processing failure
238   ///       - None
239   /// \~english @par Classification
240   ///       Public
241   /// \~english @par Type
242   ///       Sync Only
243   /// \~english @par Detail
244   ///       The function returns the signature number.
245   /// \~english @see
246   ////////////////////////////////////////////////////////////////////////////////////////////////
247   UI_32 Signature() const;
248
249   ////////////////////////////////////////////////////////////////////////////////////////////////
250   /// \ingroup NS_UtilityCenter
251   /// \~english @par Brief
252   ///       Get the structure version number
253   /// \~english @retval the structure version number
254   ///
255   /// \~english @par Prerequisite
256   ///       - None
257   /// \~english @par Change of internal state
258   ///       - None
259   /// \~english @par Conditions of processing failure
260   ///       - None
261   /// \~english @par Classification
262   ///       Public
263   /// \~english @par Type
264   ///       Sync Only
265   /// \~english @par Detail
266   ///       The function returns the structure version number.
267   /// \~english @see
268   ////////////////////////////////////////////////////////////////////////////////////////////////
269   UI_32 StrucVersion() const;
270
271   ////////////////////////////////////////////////////////////////////////////////////////////////
272   /// \ingroup NS_UtilityCenter
273   /// \~english @par Brief
274   ///       Get the product version
275   /// \~english @retval the product version
276   ///
277   /// \~english @par Prerequisite
278   ///       - None
279   /// \~english @par Change of internal state
280   ///       - None
281   /// \~english @par Conditions of processing failure
282   ///       - None
283   /// \~english @par Classification
284   ///       Public
285   /// \~english @par Type
286   ///       Sync Only
287   /// \~english @par Detail
288   ///       The function returns the product version.
289   /// \~english @see
290   ////////////////////////////////////////////////////////////////////////////////////////////////
291   UI_32 ProductVersion() const;
292
293   ////////////////////////////////////////////////////////////////////////////////////////////////
294   /// \ingroup NS_UtilityCenter
295   /// \~english @par Brief
296   ///       Get the date as number
297   /// \~english @retval the date number
298   ///
299   /// \~english @par Prerequisite
300   ///       - None
301   /// \~english @par Change of internal state
302   ///       - None
303   /// \~english @par Conditions of processing failure
304   ///       - None
305   /// \~english @par Classification
306   ///       Public
307   /// \~english @par Type
308   ///       Sync Only
309   /// \~english @par Detail
310   ///       The function returns the date as number.
311   /// \~english @see
312   ////////////////////////////////////////////////////////////////////////////////////////////////
313   UI_32 Date() const;
314
315   ////////////////////////////////////////////////////////////////////////////////////////////////
316   /// \ingroup NS_UtilityCenter
317   /// \~english @par Brief
318   ///       Get the major verion number
319   /// \~english @retval the major version number
320   ///
321   /// \~english @par Prerequisite
322   ///       - None
323   /// \~english @par Change of internal state
324   ///       - None
325   /// \~english @par Conditions of processing failure
326   ///       - None
327   /// \~english @par Classification
328   ///       Public
329   /// \~english @par Type
330   ///       Sync Only
331   /// \~english @par Detail
332   ///       The function returns the major version number.
333   /// \~english @see
334   ////////////////////////////////////////////////////////////////////////////////////////////////
335   UI_16 Major() const;
336
337   ////////////////////////////////////////////////////////////////////////////////////////////////
338   /// \ingroup NS_UtilityCenter
339   /// \~english @par Brief
340   ///       Get the minor version number
341   /// \~english @retval the minor version number
342   ///
343   /// \~english @par Prerequisite
344   ///       - None
345   /// \~english @par Change of internal state
346   ///       - None
347   /// \~english @par Conditions of processing failure
348   ///       - None
349   /// \~english @par Classification
350   ///       Public
351   /// \~english @par Type
352   ///       Sync Only
353   /// \~english @par Detail
354   ///       The function returns the minor version number.
355   /// \~english @see
356   ////////////////////////////////////////////////////////////////////////////////////////////////
357   UI_16 Minor() const;
358
359   ////////////////////////////////////////////////////////////////////////////////////////////////
360   /// \ingroup NS_UtilityCenter
361   /// \~english @par Brief
362   ///       Get the unique product identifier
363   /// \~english @retval the revision number
364   ///
365   /// \~english @par Prerequisite
366   ///       - None
367   /// \~english @par Change of internal state
368   ///       - None
369   /// \~english @par Conditions of processing failure
370   ///       - None
371   /// \~english @par Classification
372   ///       Public
373   /// \~english @par Type
374   ///       Sync Only
375   /// \~english @par Detail
376   ///       The function returns the unique product identifier generated by the build server.
377   /// \~english @see
378   ////////////////////////////////////////////////////////////////////////////////////////////////
379   PCSTR Product() const;
380
381   ////////////////////////////////////////////////////////////////////////////////////////////////
382   /// \ingroup NS_UtilityCenter
383   /// \~english @par Brief
384   ///       Get the building version string
385   /// \~english @retval the building version string
386   ///
387   /// \~english @par Prerequisite
388   ///       - None
389   /// \~english @par Change of internal state
390   ///       - None
391   /// \~english @par Conditions of processing failure
392   ///       - None
393   /// \~english @par Classification
394   ///       Public
395   /// \~english @par Type
396   ///       Sync Only
397   /// \~english @par Detail
398   ///       The function returns the unique build identifier generated by the build server.
399   /// \~english @see
400   ////////////////////////////////////////////////////////////////////////////////////////////////
401   PCSTR Build() const;
402
403   ////////////////////////////////////////////////////////////////////////////////////////////////
404   /// \ingroup NS_UtilityCenter
405   /// \~english @par Brief
406   ///       Get the revision number
407   /// \~english @retval the revision number
408   ///
409   /// \~english @par Prerequisite
410   ///       - None
411   /// \~english @par Change of internal state
412   ///       - None
413   /// \~english @par Conditions of processing failure
414   ///       - None
415   /// \~english @par Classification
416   ///       Public
417   /// \~english @par Type
418   ///       Sync Only
419   /// \~english @par Detail
420   ///       The function returns the revision as number.
421   /// \~english @see CFrameworkunifiedVersion
422   ////////////////////////////////////////////////////////////////////////////////////////////////
423   UI_16 Revision() const;
424
425  private:
426   CFrameworkunifiedVersion(const CFrameworkunifiedVersion &);
427   CFrameworkunifiedVersion &operator= (const CFrameworkunifiedVersion &);  // NOLINT (readability/nolint)
428   struct VersionInfo {
429     PSTR p_str_product;
430     UI_32 u32_signature;
431     UI_32 u32_struc_version;
432     UI_32 u32_product_version;
433     UI_32 u32_date;
434     UI_16 u16_major;
435     UI_16 u16_minor;
436     PSTR p_str_build;
437     UI_16 u16_revision;
438     VersionInfo(PSTR p, UI_32 a, UI_32 b, UI_32 c, UI_32 d, UI_16 e, UI_16 f , PSTR g, UI_16 h) :
439       u32_signature(a),
440       u32_struc_version(b),
441       u32_product_version(c),
442       u32_date(d),
443       u16_major(e),
444       u16_minor(f),
445       u16_revision(h) {
446       size_t length = strlen(p) + 1;
447       p_str_product = new CHAR[length];  // LCOV_EXCL_BR_LINE 11:except branch
448       if (NULL != p_str_product) {  // LCOV_EXCL_BR_LINE 5:new's error case
449         memset(p_str_product, 0, length);
450 #ifdef AGL_PosixBasedOS001LEGACY_USED
451         strlcpy(p_str_product, p, length);
452 #endif
453       }
454
455       length = strlen(g) + 1;
456       p_str_build = new CHAR[length];  // LCOV_EXCL_BR_LINE 11:except branch
457       if (NULL != p_str_build) {  // LCOV_EXCL_BR_LINE 5:new's error case
458         memset(p_str_build, 0, length);
459 #ifdef AGL_PosixBasedOS001LEGACY_USED
460         strlcpy(p_str_build, g , length);
461 #endif
462       }
463     }
464     ~VersionInfo() {
465       delete[] p_str_product;  // LCOV_EXCL_BR_LINE 11:except branch
466       p_str_product = NULL;
467       delete[] p_str_build;  // LCOV_EXCL_BR_LINE 11:except branch
468       p_str_build = NULL;
469     }
470   } m_tVersionInfo;
471   UI_32 m_u32Month;
472   UI_32 m_u32Year;
473   UI_32 m_u32Day;
474 };
475
476 /**
477  * \~english define macro for version string
478  */
479 #define FRAMEWORKUNIFIED_GET_VERSION() "undefined_undefined_00.00.00"
480
481 /**
482  * \~english define macro for the major number of the version
483  */
484 #define FRAMEWORKUNIFIED_APP_VERSION_MAJOR() (0)
485
486 /**
487  * \~english define macro for the minor number of the version
488  */
489 #define FRAMEWORKUNIFIED_APP_VERSION_MINOR() (0)
490
491 /**
492  * \~english define macro for the revision number
493  */
494 #define FRAMEWORKUNIFIED_APP_VERSION_REVISION() (0)
495
496 /**
497  * \~english define macro for the building version
498  */
499 #define FRAMEWORKUNIFIED_APP_VERSION_BUILDVER() "undefined"
500
501 /**
502  * \~english define macro for product version
503  */
504 #define FRAMEWORKUNIFIED_APP_VERSION_PRODUCTID() "undefined"
505
506 #endif  // NS_NATIVESERVICES_INC_NATIVE_NS_VERSION_IF_H_  // NOLINT  (build/header_guard)
507 /** @}*/  // end of native
508 /** @}*/  // end of framework_unified
509 /** @}*/  // end of native_service
510 /** @}*/  // end of BaseSystem