diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-10 21:27:08 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-10 22:17:43 +0100 |
commit | ee1a527191db646850ee919b8fe3a6f8cb6cd693 (patch) | |
tree | a1ff23b8c0f93d689d51d3837caefaa72b9480cd /anim-crop-tool | |
parent | 0e23ba9e5a565e34fee0f024e29ce162f420ec22 (diff) |
get rid of std::string
Diffstat (limited to 'anim-crop-tool')
-rw-r--r-- | anim-crop-tool/main.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/anim-crop-tool/main.cpp b/anim-crop-tool/main.cpp index ea0614ca..ae3c2af3 100644 --- a/anim-crop-tool/main.cpp +++ b/anim-crop-tool/main.cpp @@ -211,8 +211,8 @@ static std::tuple<options, Arguments, bool> parse_cmdline(int argc, const char* opts.width = w; if (auto h = args.value<unsigned>("height"); h != 0) opts.height = h; - opts.output_dir = args.value<std::string>("output"); - opts.input_file = args.value<std::string>("input"); + opts.output_dir = args.value<StringView>("output"); + opts.input_file = args.value<StringView>("input"); opts.input_dir = Path::split(opts.input_file).first(); if (opts.output_dir.isEmpty()) @@ -227,17 +227,17 @@ static std::tuple<options, Arguments, bool> parse_cmdline(int argc, const char* return EX_USAGE; } -[[nodiscard]] static bool check_atlas_name(const std::string& str) noexcept +[[nodiscard]] static bool check_atlas_name(StringView str) noexcept { constexpr auto npos = std::string::npos; - if (str.empty()) + if (str.isEmpty()) return false; if (str[0] == '.' || str[0] == '\\' || str[0] == '/') return false; - if (str.find('"') != npos || str.find('\'') != npos) + if (str.find('"') || str.find('\'')) return false; - if (str.find("/.") != npos || str.find("\\.") != npos) + if (str.find("/.") || str.find("\\.")) return false; // NOLINT(readability-simplify-boolean-expr) return true; |