Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
sabudilovskiy committed Aug 1, 2023
1 parent a1f8f77 commit 458f048
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 10 deletions.
9 changes: 9 additions & 0 deletions .gen/objs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,22 @@ src/utils/constexpr_string.hpp
src/utils/constexpr_optional.hpp
src/utils/component_list_fwd.hpp
src/utils/common_errors.hpp
src/openapi/types/string_type.hpp
src/openapi/types/object_type.hpp
src/openapi/types/array_type.hpp
src/openapi/json/parse/string_property.hpp
src/openapi/json/parse/object_property.hpp
src/openapi/json/parse/array_property.hpp
src/openapi/base/string_traits.hpp
src/openapi/base/string_property.hpp
src/openapi/base/reflective_property.hpp
src/openapi/base/property_base.hpp
src/openapi/base/preferences.hpp
src/openapi/base/optional_property.hpp
src/openapi/base/object_traits.hpp
src/openapi/base/object_property.hpp
src/openapi/base/named_traits.hpp
src/openapi/base/extended_object_property.hpp
src/openapi/base/array_traits.hpp
src/openapi/base/array_property.hpp
src/models/user_type/type.hpp
Expand Down
4 changes: 3 additions & 1 deletion .gen/unittest.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
utests/openapi/json/parse/basic.cpp
utests/openapi/json/parse/basic_string.cpp
utests/openapi/json/parse/basic_object.cpp
utests/openapi/json/parse/basic_array.cpp
utests/hello_test.cpp
utests/dropper_additional.cpp
utests/dropper.cpp
Expand Down
27 changes: 18 additions & 9 deletions src/utils/constexpr_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ struct ConstexprString
{
return AsStringView();
}
constexpr const char& operator[](size_t index) const{
constexpr const char& operator[](size_t index) const
{
return contents[index];
}

constexpr char& operator[](size_t index){
constexpr char& operator[](size_t index)
{
return contents[index];
}

Expand All @@ -36,7 +38,13 @@ struct ConstexprString
return {contents.begin(), contents.begin() + Size - 1};
}

constexpr bool empty() const{
constexpr const char* data() const
{
return contents.begin();
}

constexpr bool empty() const
{
return Size == 1;
}

Expand All @@ -55,13 +63,14 @@ struct ConstexprString
{
return string == lhs;
}
};
template < std::size_t n >
ConstexprString ( char const(&)[n] ) -> ConstexprString<n>;
};
template <std::size_t n>
ConstexprString(char const (&)[n]) -> ConstexprString<n>;

template<std::array<char, 256> arr_>
auto consteval MakeConstexprString(){
constexpr auto real_end_it= std::find(begin(arr_), end(arr_), '\0');
template <std::array<char, 256> arr_>
auto consteval MakeConstexprString()
{
constexpr auto real_end_it = std::find(begin(arr_), end(arr_), '\0');
constexpr auto len = real_end_it - begin(arr_);
char buffer[len + 1]{};
std::copy(begin(arr_), real_end_it, std::begin(buffer));
Expand Down
26 changes: 26 additions & 0 deletions vsu_timetable.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"vadimcn.vscode-lldb",
"ms-vscode.cmake-tools",
"notskm.clang-tidy",
"forbeslindesay.forbeslindesay-taskrunner",
"ms-vscode.cpptools"
]
},
Expand All @@ -25,5 +26,30 @@
"compile_commands.json" : true
},
"clang-tidy.buildPath": "build_debug"
},
"tasks": {
"version": "2.0.0",
"tasks": [
{
"label": "Отформатировать весь код",
"command": "make",
"type": "shell",
"args": ["-s", "format-all"],
"presentation": {
"reveal": "always"
},
"group": "none"
},
{
"label": "Запустить юнит тесты",
"command": "make",
"type": "shell",
"args": ["-s", "utest-debug"],
"presentation": {
"reveal": "always"
},
"group": "none"
}
]
}
}

0 comments on commit 458f048

Please sign in to comment.