mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
added file path tests. they all fail but hey they're there lol
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include <codecvt>
|
||||
#include <locale>
|
||||
#include <random>
|
||||
|
||||
#include <systemd/sd-id128.h>
|
||||
@@ -98,5 +100,21 @@ std::string RandWPAPassphrase() {
|
||||
|
||||
return RandString(allowed_chars, 63);
|
||||
}
|
||||
|
||||
std::string wstring_to_string(const std::wstring& str) {
|
||||
if (str.empty()) {
|
||||
return {};
|
||||
}
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
|
||||
return converter.to_bytes(str);
|
||||
}
|
||||
|
||||
std::wstring string_to_wstring(const std::string& str) {
|
||||
if (str.empty()) {
|
||||
return {};
|
||||
}
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
|
||||
return converter.from_bytes(str);
|
||||
}
|
||||
} // namespace linux
|
||||
} // namespace nearby
|
||||
|
||||
Reference in New Issue
Block a user