added file path tests. they all fail but hey they're there lol

This commit is contained in:
lasan
2026-06-05 11:01:01 +05:30
parent 84eaf3ef27
commit 314042740f
5 changed files with 190 additions and 121 deletions
@@ -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