diff options
author | 2017-02-05 16:01:50 +0100 | |
---|---|---|
committer | 2017-02-05 16:06:06 +0100 | |
commit | ac096aa2a0921efde96b76252dffb119dcf27efc (patch) | |
tree | 2ad9a28a7f6babce8cfcbf5995e3e055ff13ff60 /3rdparty/sol2/sol/string_shim.hpp | |
parent | 29df715138452ee18ba19ec4b07e18c4b3185de7 (diff) |
Update sol2 (nw)
Diffstat (limited to '3rdparty/sol2/sol/string_shim.hpp')
-rw-r--r-- | 3rdparty/sol2/sol/string_shim.hpp | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/3rdparty/sol2/sol/string_shim.hpp b/3rdparty/sol2/sol/string_shim.hpp index b1e685bddc8..73aa81646fb 100644 --- a/3rdparty/sol2/sol/string_shim.hpp +++ b/3rdparty/sol2/sol/string_shim.hpp @@ -1,4 +1,26 @@ -#pragma once +// The MIT License (MIT) + +// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors + +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +// the Software, and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#ifndef SOL_STRING_SHIM_HPP +#define SOL_STRING_SHIM_HPP #include <cstddef> #include <string> @@ -10,8 +32,8 @@ namespace sol { const char* p; string_shim(const std::string& r) : string_shim(r.data(), r.size()) {} - string_shim(const char* p) : string_shim(p, std::char_traits<char>::length(p)) {} - string_shim(const char* p, std::size_t s) : s(s), p(p) {} + string_shim(const char* ptr) : string_shim(ptr, std::char_traits<char>::length(ptr)) {} + string_shim(const char* ptr, std::size_t sz) : s(sz), p(ptr) {} static int compare(const char* lhs_p, std::size_t lhs_sz, const char* rhs_p, std::size_t rhs_sz) { int result = std::char_traits<char>::compare(lhs_p, rhs_p, lhs_sz < rhs_sz ? lhs_sz : rhs_sz); @@ -61,4 +83,6 @@ namespace sol { } }; } -}
\ No newline at end of file +} + +#endif // SOL_STRING_SHIM_HPP |