ThinSQLite++
A thin, safe and convenient modern C++ wrapper for SQLite API.
Loading...
Searching...
No Matches
string_param.hpp
1/*
2 Copyright 2019 Eugene Gershnik
3
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file or at
6 https://github.com/gershnik/thinsqlitepp/blob/main/LICENSE
7*/
8
9#ifndef HEADER_SQLITEPP_STRING_PARAM_IFACE_INCLUDED
10#define HEADER_SQLITEPP_STRING_PARAM_IFACE_INCLUDED
11
12#include "config.hpp"
13
14#include <string>
15#include <memory>
16
17namespace thinsqlitepp
18{
35 template<class T>
37 {
38 public:
40 basic_string_param(const T * str) noexcept : _str(str)
41 {}
43 basic_string_param(const std::basic_string<T> & str) noexcept : _str(str.c_str())
44 {}
46 basic_string_param(std::nullptr_t) noexcept : _str(nullptr)
47 {}
48
50 const T * c_str() const noexcept
51 { return _str; }
52 private:
53 const T * _str;
54 };
55
58
59#if __cpp_char8_t >= 201811
60
63
64#endif
65
67}
68
69#endif
70
71
72
A reference to a null terminated string.
Definition string_param.hpp:37
const T * c_str() const noexcept
Returns the stored pointer.
Definition string_param.hpp:50
basic_string_param(const std::basic_string< T > &str) noexcept
Construct an instance from std::basic_string<T>::c_str()
Definition string_param.hpp:43
basic_string_param(std::nullptr_t) noexcept
Construct an instance from a nullptr.
Definition string_param.hpp:46
basic_string_param(const T *str) noexcept
Construct an instance from a raw pointer.
Definition string_param.hpp:40
ThinSQLite++ namespace.
Definition backup_iface.hpp:17