-
-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
412 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Run unit_tests", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/build/tests/unit_tests", | ||
"args": [], | ||
"cwd": "${workspaceFolder}", | ||
"stopAtEntry": false, | ||
"environment": [], | ||
"externalConsole": false, | ||
"MIMode": "lldb" | ||
}, | ||
{ | ||
"name": "Run amalgamate script", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/third_party/amalgamate/amalgamate.py", | ||
"args": [ | ||
"-c", "${workspaceFolder}/third_party/amalgamate/config.json", | ||
"-s", "${workspaceFolder}" | ||
], | ||
"cwd": "${workspaceFolder}", | ||
"console": "integratedTerminal" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"files.associations": { | ||
"*.c": "c", | ||
"string": "cpp", | ||
"__bit_reference": "cpp", | ||
"__hash_table": "cpp", | ||
"__split_buffer": "cpp", | ||
"__tree": "cpp", | ||
"array": "cpp", | ||
"deque": "cpp", | ||
"forward_list": "cpp", | ||
"initializer_list": "cpp", | ||
"list": "cpp", | ||
"map": "cpp", | ||
"set": "cpp", | ||
"span": "cpp", | ||
"string_view": "cpp", | ||
"unordered_map": "cpp", | ||
"vector": "cpp", | ||
"chrono": "cpp", | ||
"format": "cpp", | ||
"ranges": "cpp", | ||
"text_encoding": "cpp", | ||
"__locale": "cpp", | ||
"__node_handle": "cpp", | ||
"__verbose_abort": "cpp", | ||
"bitset": "cpp", | ||
"cctype": "cpp", | ||
"charconv": "cpp", | ||
"cmath": "cpp", | ||
"codecvt": "cpp", | ||
"cstdarg": "cpp", | ||
"cstddef": "cpp", | ||
"cstdint": "cpp", | ||
"cstdio": "cpp", | ||
"cstdlib": "cpp", | ||
"cstring": "cpp", | ||
"ctime": "cpp", | ||
"cwchar": "cpp", | ||
"cwctype": "cpp", | ||
"memory": "cpp", | ||
"iomanip": "cpp", | ||
"ios": "cpp", | ||
"iosfwd": "cpp", | ||
"istream": "cpp", | ||
"limits": "cpp", | ||
"locale": "cpp", | ||
"mutex": "cpp", | ||
"new": "cpp", | ||
"optional": "cpp", | ||
"ostream": "cpp", | ||
"print": "cpp", | ||
"ratio": "cpp", | ||
"sstream": "cpp", | ||
"stdexcept": "cpp", | ||
"streambuf": "cpp", | ||
"tuple": "cpp", | ||
"typeindex": "cpp", | ||
"typeinfo": "cpp", | ||
"variant": "cpp", | ||
"algorithm": "cpp", | ||
"clocale": "cpp", | ||
"atomic": "cpp", | ||
"bit": "cpp", | ||
"*.tcc": "cpp", | ||
"compare": "cpp", | ||
"concepts": "cpp", | ||
"exception": "cpp", | ||
"functional": "cpp", | ||
"iterator": "cpp", | ||
"memory_resource": "cpp", | ||
"random": "cpp", | ||
"system_error": "cpp", | ||
"type_traits": "cpp", | ||
"utility": "cpp", | ||
"__config": "cpp" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Run unit_tests", | ||
"type": "shell", | ||
"command": "${workspaceFolder}/build/tests/unit_tests", | ||
"options": { | ||
"cwd": "${workspaceFolder}/build/tests" | ||
}, | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true | ||
}, | ||
"problemMatcher": [], | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "shared" | ||
} | ||
}, | ||
{ | ||
"label": "Run amalgamate script", | ||
"type": "shell", | ||
"command": "python3", | ||
"args": [ | ||
"third_party/amalgamate/amalgamate.py", | ||
"-c", | ||
"third_party/amalgamate/config.json", | ||
"-s", | ||
"." | ||
], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": false | ||
}, | ||
"problemMatcher": [], | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "shared" | ||
} | ||
}, | ||
{ | ||
"label": "Run clang-format", | ||
"type": "shell", | ||
"command": "clang-format", | ||
"args": [ | ||
"-i", | ||
"-style=file", | ||
"include/sqlite_orm/*.h", | ||
"tests/*.cpp", | ||
"tests/*/*.cpp", | ||
"tests/*/*/*.cpp", | ||
"dev/*.h", | ||
"dev/*/*.h", | ||
"tests/*/*.h", | ||
"examples/*.cpp", | ||
"examples/*/src/*.cpp" | ||
], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": false | ||
}, | ||
"problemMatcher": [], | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "shared" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include <array> // std::array | ||
#include <string> // std::string | ||
#include <utility> // std::pair | ||
#include <iterator> // std::back_inserter | ||
|
||
#include "serialize_result_type.h" | ||
|
||
namespace sqlite_orm { | ||
enum class locking_mode : signed char { | ||
NORMAL = 0, | ||
EXCLUSIVE = 1, | ||
}; | ||
|
||
namespace internal { | ||
inline const serialize_result_type& to_string(locking_mode value) { | ||
static const std::array<serialize_result_type, 2> res = { | ||
"NORMAL", | ||
"EXCLUSIVE", | ||
}; | ||
return res.at(static_cast<int>(value)); | ||
} | ||
|
||
inline std::pair<bool, locking_mode> locking_mode_from_string(const std::string& string) { | ||
std::string upperString; | ||
std::transform(string.begin(), string.end(), std::back_inserter(upperString), [](char c) { | ||
return static_cast<char>(std::toupper(static_cast<int>(c))); | ||
}); | ||
static const std::array<locking_mode, 2> allValues = {{ | ||
locking_mode::NORMAL, | ||
locking_mode::EXCLUSIVE, | ||
}}; | ||
for(auto lockingMode: allValues) { | ||
if(to_string(lockingMode) == upperString) { | ||
return {true, lockingMode}; | ||
} | ||
} | ||
return {false, locking_mode::NORMAL}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.