NSVD Reader  0.0.1
void_value.hpp
Go to the documentation of this file.
1 
5 /*
6  * These codes are licensed under CC0.
7  * http://creativecommons.org/publicdomain/zero/1.0/
8  */
9 
10 #ifndef __NODAMUSHI_SVD_VALUE_VOID_VALUE_HPP__
11 #define __NODAMUSHI_SVD_VALUE_VOID_VALUE_HPP__
12 
13 # include "nodamushi/svd/value.hpp"
14 namespace nodamushi{
15 namespace svd{
16 
17 // void
18 template<bool attribute,bool r,char... name>struct value<void,attribute,r,name...>
19 {
20  using type = void;
21  static constexpr bool REQUIRED=false;
22  static constexpr bool ATTRIBUTE=attribute;
23 
24 
25  constexpr bool empty()const noexcept{return true;}
26  constexpr operator bool()const noexcept{return false;}
27  constexpr bool check_require()const noexcept{return true;}
28  constexpr bool is_required()const noexcept{return false;}
29  constexpr bool is_attribute()const noexcept{return attribute;}
30  int operator*()const noexcept{return 0;}
31  int get()const noexcept{return 0;}
33  {
34 # if __cplusplus >= 201703
35  return get_const_string<name...>();
36 # else
37  const char arr[] = {name...,'\0'};
38  return std::string(arr);
39 # endif
40  }
41 };
42 }}// end namespace nodamushi::svd
43 
44 #endif // __NODAMUSHI_SVD_VALUE_VOID_VALUE_HPP__
constexpr bool is_attribute() const noexcept
Definition: void_value.hpp:29
constexpr const_string get_const_string()
constexpr bool is_required() const noexcept
Definition: void_value.hpp:28
constexpr bool check_require() const noexcept
Definition: void_value.hpp:27
This class reperesents SVD(xml) element / attribute.
Definition: value.hpp:53
static constexpr bool ATTRIBUTE
Definition: value.hpp:60
#define NODAMUSHI_CONSTEXPR_STRING
Definition: string_type.hpp:46
type & operator *()
get value
Definition: value.hpp:164
static constexpr bool REQUIRED
Definition: value.hpp:59
value class, empty_value_access_error class