aboutsummaryrefslogtreecommitdiff
path: root/lib/uri.cpp
AgeCommit message (Collapse)Author
2022-01-18Don't use 'static' on top-level/namespace scopeAlexey Rusakov
When internal linkage is necessary, anonymous namespaces fulfil the same purpose in a better way. See also: https://stackoverflow.com/questions/4422507/superiority-of-unnamed-namespace-over-static
2022-01-18Move over non-interface code to QLatin1StringAlexey Rusakov
It's better than const char* because any interaction between const char* and QString assumes that const char* contains UTF-8, which is pessimistic and therefore inefficient; at the same time: - construction of QString from QLatin1String is extremely fast (boiling down to padding null bytes) - "something"_ls is much shorter than QStringLiteral("something") - "something"_ls produces a direct pointer to the literal at compile time, using the benefits of raw string literals (deduplication, e.g.) The library API will also transition to QLatin1String where applicable, likely in 0.8.
2022-01-18Revise inline keyword usageAlexey Rusakov
- Templates and constexpr imply inline - A function called from a single site better be inlined.
2021-06-13Uri: Fix ambiguity around QChar constructorsAlexey Rusakov
QChar now accepts more types for construction, and that unraveled concatenation of a Type/SecondaryType character with a QString. To fix it, give the compiler a hint by casting to the enum's underlying type (which also nicely documents that we _actually_ switch from enum to character type).
2021-06-13uri.cpp, room.*: Get rid of QStringRefsAlexey Rusakov
2021-02-21Uri: support abbreviated types in Matrix URIsAlexey Rusakov
As per the latest iteration of MSC2312, room/, user/ and event/ are only supported for parsing and replication but not for emitting from Matrix identifiers. (cherry picked from commit 86f24d1ecf300b82b3a7253b81a2c392669d2c2b)
2021-01-16Updated copyright statements upon Git auditKitsune Ral
After going through all the files and the history of commits on them it was clear that some copyright statements are obsolete (the code has been overwritten since) and some are missing. This commit tries best to remedy that, along with adding SPDX tags where they were still not used. Also, a minimal SPDX convention is documented for further contributions. Closes #426.
2020-12-24Fix clang-tidy/clazy warningsKitsune Ral
(cherry picked from commit 0a2acd750a4155969092be674ed3dd9a71b2354f)
2020-12-10Uri: fix a few cases of insufficient escapingKitsune Ral
2020-11-06Uri::toUrl(): fix incorrect matrix.to repKitsune Ral
The first character inside the fragment should be / (cherry picked from commit 948be2ef2bf04e306fbb0e2c3e0a98f4151337a7)
2020-07-21Uri: bare-sigil URIs are invalidKitsune Ral
2020-07-19MatrixUri->Uri: Extend to non-Matrix URIsKitsune Ral