Commit Graph

9 Commits

Author SHA1 Message Date
Charles Kerr c0bb2d40f1
refactor: add pathbuf and std::string-friendly helpers to tr_sys file and path funcs (#3118)
* refactor: add sv-friendly tr_sys_dir_create() variant

* refactor: add sv-friendly tr_sys_path_get_info() variant

* refactor: add sv-friendly tr_sys_path_exists() variant

* refactor: add sv-friendly tr_sys_path_remove() variant

* refactor: add sv-friendly tr_sys_path_rename() variant

* fixup! refactor: add sv-friendly tr_sys_path_rename() variant
2022-05-21 20:17:00 -05:00
Charles Kerr aa2bb367ab
chore: iwyu cleanup (#2981) 2022-04-24 20:49:52 -05:00
Antoine Cœur bdac708762
docs: fix various typos and misspellings (#2955) 2022-04-21 09:28:38 -05:00
Charles Kerr 1d7d17396f
refactor: remove tr_snprintf() pt 2 (#2871) 2022-04-03 13:23:00 -05:00
Charles Kerr 4dd25d8112
fix: tr_strbuf move op loses zero-termination (#2843) 2022-03-30 12:10:51 -05:00
Charles Kerr 4177e286a1
fix: sonarcloud (#2837)
* fix: rename variable to avoid shadow warning w/UTP

* fix: add default dtor for tr_strbuf

* fix: implicit conversion may lose precision

* fix: use init-statement to reduce variable scope

* fix: implicit conversion may lose precision

* fix: extract the assignment from this expression

* fix: use init-statement to reduce variable scope

* fix: use init-statement to reduce variable scope

* fix: do not mix public and private data members

* fix: add a condition to cv.wait call

* fix: do not throw uncaught exceptions in destructor
2022-03-29 05:57:04 -05:00
Charles Kerr 9d141ee2b1
refactor: add fmt::formatters (#2829)
* refactor: add fmt::formatters
2022-03-27 21:55:30 -05:00
Charles Kerr 1051160b99
feat: strbuf features (#2821)
* feat: strbuf is always zero-terminated

* feat: tr_strbuf::append() now takes any number of args

* feat: tr_strbuf handles zero-terminated string inputs

* feat: add tr_strbuf::ends_with()

* feat: add tr_strbuf::starts_with()

* refactor: replace buildPath() with join()
2022-03-25 16:16:26 -05:00
Charles Kerr 6e8f9f3ff0
feat: add tr_strbuf (#2810)
* feat: add tr_strbuf class for building tmp strings

Based on fmt::basic_memory_buf, this is a growable string buffer that
has an initial size that's large enough to build most filenames or URLs
without needing heap allocations.

Adds a couple of extra helpers such as a `c_str()` method to make dealing
with old zero-terminated string APIs easier.
2022-03-24 16:41:29 -05:00