aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorpg <pg@yandex-team.com>2023-03-28 21:30:10 +0300
committerpg <pg@yandex-team.com>2023-03-28 21:30:10 +0300
commit25659221f18577ea38430a8ec3349836f5626b6a (patch)
tree61f1c68d385eb4bde77c5c12e055eb6f44e1f9ae /util
parenta30195c57a0e043158d80a4385350eee326197f1 (diff)
downloadydb-25659221f18577ea38430a8ec3349836f5626b6a.tar.gz
Diffstat (limited to 'util')
-rw-r--r--util/charset/wide.h26
-rw-r--r--util/generic/guid.h20
-rw-r--r--util/generic/guid_ut.cpp8
-rw-r--r--util/generic/ptr_ut.cpp4
-rw-r--r--util/generic/vector_ut.cpp4
-rw-r--r--util/stream/trace.h36
-rw-r--r--util/stream/zerocopy.h20
-rw-r--r--util/string/ascii.h20
-rw-r--r--util/string/join.h2
-rw-r--r--util/string/reverse.h12
-rw-r--r--util/system/compiler.h4
-rw-r--r--util/system/shellcommand.h38
-rw-r--r--util/system/tempfile.h2
-rw-r--r--util/thread/pool.h6
14 files changed, 101 insertions, 101 deletions
diff --git a/util/charset/wide.h b/util/charset/wide.h
index 04e6928aab..6da3c76252 100644
--- a/util/charset/wide.h
+++ b/util/charset/wide.h
@@ -740,18 +740,18 @@ bool ToLower(TUtf16String& text, size_t pos = 0, size_t count = TUtf16String::np
bool ToUpper(TUtf16String& text, size_t pos = 0, size_t count = TUtf16String::npos);
/* Lowercase/uppercase given string inplace. Any alphabetic symbol will be converted to a proper
-* case, the rest of the symbols will be kept the same. It is expected that `text` is a correct
-* UTF-32 string.
-*
-* For example `ToLower("heLLo")` will return `"hello"`.
-*
-* @param text String to modify
-* @param pos Position of the first character to modify
-* @param count Length of the substring
-* @returns `true` if `text` was changed
-*
-* NOTE: `pos` and `count` are measured in `wchar16`, not in codepoints.
-*/
+ * case, the rest of the symbols will be kept the same. It is expected that `text` is a correct
+ * UTF-32 string.
+ *
+ * For example `ToLower("heLLo")` will return `"hello"`.
+ *
+ * @param text String to modify
+ * @param pos Position of the first character to modify
+ * @param count Length of the substring
+ * @returns `true` if `text` was changed
+ *
+ * NOTE: `pos` and `count` are measured in `wchar16`, not in codepoints.
+ */
bool ToLower(TUtf32String& /*text*/, size_t /*pos*/ = 0, size_t /*count*/ = TUtf16String::npos);
bool ToUpper(TUtf32String& /*text*/, size_t /*pos*/ = 0, size_t /*count*/ = TUtf16String::npos);
@@ -760,7 +760,7 @@ bool ToUpper(TUtf32String& /*text*/, size_t /*pos*/ = 0, size_t /*count*/ = TUtf
bool ToTitle(TUtf16String& text, size_t pos = 0, size_t count = TUtf16String::npos);
/* Titlecase first symbol and lowercase the rest, see `ToLower` for more details.
-*/
+ */
bool ToTitle(TUtf32String& /*text*/, size_t /*pos*/ = 0, size_t /*count*/ = TUtf16String::npos);
/* @param text Pointer to the string to modify
diff --git a/util/generic/guid.h b/util/generic/guid.h
index 2bf6c8ad99..93e06a81f8 100644
--- a/util/generic/guid.h
+++ b/util/generic/guid.h
@@ -29,18 +29,18 @@ struct TGUID {
TString AsGuidString() const;
/**
- * RFC4122 GUID, which described in
- * https://en.wikipedia.org/wiki/Universally_unique_identifier
- * xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- **/
+ * RFC4122 GUID, which described in
+ * https://en.wikipedia.org/wiki/Universally_unique_identifier
+ * xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ **/
TString AsUuidString() const;
static TGUID Create();
/**
- * Generate time based UUID version 1 RFC4122 GUID
- * https://datatracker.ietf.org/doc/html/rfc4122#section-4.1
- **/
+ * Generate time based UUID version 1 RFC4122 GUID
+ * https://datatracker.ietf.org/doc/html/rfc4122#section-4.1
+ **/
static TGUID CreateTimebased();
};
@@ -72,8 +72,8 @@ TGUID GetGuid(TStringBuf s);
bool GetGuid(TStringBuf s, TGUID& result);
/**
-* Functions for correct parsing RFC4122 GUID, which described in
-* https://en.wikipedia.org/wiki/Universally_unique_identifier
-**/
+ * Functions for correct parsing RFC4122 GUID, which described in
+ * https://en.wikipedia.org/wiki/Universally_unique_identifier
+ **/
TGUID GetUuid(TStringBuf s);
bool GetUuid(TStringBuf s, TGUID& result);
diff --git a/util/generic/guid_ut.cpp b/util/generic/guid_ut.cpp
index 048354ff39..82347941e6 100644
--- a/util/generic/guid_ut.cpp
+++ b/util/generic/guid_ut.cpp
@@ -97,10 +97,10 @@ Y_UNIT_TEST_SUITE(TGuidTest) {
Y_UNIT_TEST(DoubleConvert) {
/**
- * test print and parsing RFC4122 GUID, which described in
- * https://en.wikipedia.org/wiki/Universally_unique_identifier
- * xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- **/
+ * test print and parsing RFC4122 GUID, which described in
+ * https://en.wikipedia.org/wiki/Universally_unique_identifier
+ * xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ **/
auto guid = TGUID::Create();
auto printed = guid.AsUuidString();
diff --git a/util/generic/ptr_ut.cpp b/util/generic/ptr_ut.cpp
index 5f0fd2d470..6354d681bf 100644
--- a/util/generic/ptr_ut.cpp
+++ b/util/generic/ptr_ut.cpp
@@ -546,8 +546,8 @@ namespace {
static TFrom Get();
/*
- * Result == (TFrom could be converted to TTo implicitly)
- */
+ * Result == (TFrom could be converted to TTo implicitly)
+ */
enum {
Result = (sizeof(Func(Get())) != sizeof(RTNo))
};
diff --git a/util/generic/vector_ut.cpp b/util/generic/vector_ut.cpp
index 4a9d286572..63b10edab5 100644
--- a/util/generic/vector_ut.cpp
+++ b/util/generic/vector_ut.cpp
@@ -420,8 +420,8 @@ private:
}
/* This test check a potential issue with empty base class
- * optimization. Some compilers (VC6) do not implement it
- * correctly resulting ina wrong behavior. */
+ * optimization. Some compilers (VC6) do not implement it
+ * correctly resulting ina wrong behavior. */
void TestEbo() {
// We use heap memory as test failure can corrupt vector internal
// representation making executable crash on vector destructor invocation.
diff --git a/util/stream/trace.h b/util/stream/trace.h
index e74b6ecf3e..6169246c7d 100644
--- a/util/stream/trace.h
+++ b/util/stream/trace.h
@@ -22,24 +22,24 @@ enum ETraceLevel: ui8 {
#ifdef Y_ENABLE_TRACE
/**
- * Writes the given data into standard debug stream if current debug level set
- * via `DBGOUT` environment variable permits it.
- *
- * Does nothing in release builds unless `Y_ENABLE_TRACE` is defined.
- *
- * Example usage:
- * @code
- * Y_DBGTRACE(DEBUG, "Advance from " << node1 << " to " << node2);
- * @endcode
- *
- * @param elevel Debug level of this trace command, e.g.
- * `WARN` or `DEBUG`. Basically a suffix of
- * one of the values of `ETraceLevel` enum.
- * @param args Argument chain to be written out into
- * standard debug stream, joined with `<<`
- * operator.
- * @see ETraceLevel
- */
+ * Writes the given data into standard debug stream if current debug level set
+ * via `DBGOUT` environment variable permits it.
+ *
+ * Does nothing in release builds unless `Y_ENABLE_TRACE` is defined.
+ *
+ * Example usage:
+ * @code
+ * Y_DBGTRACE(DEBUG, "Advance from " << node1 << " to " << node2);
+ * @endcode
+ *
+ * @param elevel Debug level of this trace command, e.g.
+ * `WARN` or `DEBUG`. Basically a suffix of
+ * one of the values of `ETraceLevel` enum.
+ * @param args Argument chain to be written out into
+ * standard debug stream, joined with `<<`
+ * operator.
+ * @see ETraceLevel
+ */
#define Y_DBGTRACE(elevel, args) Y_DBGTRACE0(int(TRACE_##elevel), args)
#define Y_DBGTRACE0(level, args) \
do \
diff --git a/util/stream/zerocopy.h b/util/stream/zerocopy.h
index 3315aa3a51..7676b1baff 100644
--- a/util/stream/zerocopy.h
+++ b/util/stream/zerocopy.h
@@ -57,10 +57,10 @@ protected:
};
/**
-* Input stream with direct access to the input buffer and ability to undo read
-*
-* Derived classes must implement `DoUndo` method.
-*/
+ * Input stream with direct access to the input buffer and ability to undo read
+ *
+ * Derived classes must implement `DoUndo` method.
+ */
class IZeroCopyInputFastReadTo: public IZeroCopyInput {
public:
IZeroCopyInputFastReadTo() noexcept = default;
@@ -74,12 +74,12 @@ protected:
private:
/**
- * Undo read.
- *
- * Note that this function not check if you try undo more that read. In fact Undo used for undo read in last chunk.
- *
- * @param len[in] Bytes to undo.
- */
+ * Undo read.
+ *
+ * Note that this function not check if you try undo more that read. In fact Undo used for undo read in last chunk.
+ *
+ * @param len[in] Bytes to undo.
+ */
inline void Undo(size_t len) {
if (len) {
DoUndo(len);
diff --git a/util/string/ascii.h b/util/string/ascii.h
index d376af153a..94bf920e81 100644
--- a/util/string/ascii.h
+++ b/util/string/ascii.h
@@ -233,21 +233,21 @@ static inline bool AsciiHasPrefix(const TStringBuf s1, const TStringBuf s2) noex
}
/**
- * ASCII case-insensitive string comparison (for proper UTF8 strings
- * case-insensitive comparison consider using @c library/cpp/charset).
- *
- * @return true iff @c s2 are case-insensitively prefix of @c s1.
- */
+ * ASCII case-insensitive string comparison (for proper UTF8 strings
+ * case-insensitive comparison consider using @c library/cpp/charset).
+ *
+ * @return true iff @c s2 are case-insensitively prefix of @c s1.
+ */
static inline bool AsciiHasPrefixIgnoreCase(const TStringBuf s1, const TStringBuf s2) noexcept {
return (s1.size() >= s2.size()) && strnicmp(s1.data(), s2.data(), s2.size()) == 0;
}
/**
- * ASCII case-insensitive string comparison (for proper UTF8 strings
- * case-insensitive comparison consider using @c library/cpp/charset).
- *
- * @return true iff @c s2 are case-insensitively suffix of @c s1.
- */
+ * ASCII case-insensitive string comparison (for proper UTF8 strings
+ * case-insensitive comparison consider using @c library/cpp/charset).
+ *
+ * @return true iff @c s2 are case-insensitively suffix of @c s1.
+ */
static inline bool AsciiHasSuffixIgnoreCase(const TStringBuf s1, const TStringBuf s2) noexcept {
return (s1.size() >= s2.size()) && strnicmp((s1.data() + (s1.size() - s2.size())), s2.data(), s2.size()) == 0;
}
diff --git a/util/string/join.h b/util/string/join.h
index b166fad1f3..e3c08ef584 100644
--- a/util/string/join.h
+++ b/util/string/join.h
@@ -250,7 +250,7 @@ constexpr auto MakeRangeJoiner(TStringBuf delim, const std::initializer_list<TVa
* This way JoinSeq(",", { s1, s2 }) always does the right thing whatever types s1 and s2 have.
*
* If someone needs to join std::initializer_list<TString> -- it still works because of the TContainer template above.
-*/
+ */
template <typename T>
inline std::enable_if_t<
diff --git a/util/string/reverse.h b/util/string/reverse.h
index 80f8b00887..3a70eef061 100644
--- a/util/string/reverse.h
+++ b/util/string/reverse.h
@@ -5,12 +5,12 @@
void ReverseInPlace(TString& string);
/** NB. UTF-16 is variable-length encoding because of the surrogate pairs.
- * This function takes this into account and treats a surrogate pair as a single symbol.
- * Ex. if [C D] is a surrogate pair,
- * A B [C D] E
- * will become
- * E [C D] B A
- */
+ * This function takes this into account and treats a surrogate pair as a single symbol.
+ * Ex. if [C D] is a surrogate pair,
+ * A B [C D] E
+ * will become
+ * E [C D] B A
+ */
void ReverseInPlace(TUtf16String& string);
void ReverseInPlace(TUtf32String& string);
diff --git a/util/system/compiler.h b/util/system/compiler.h
index c7b73ed51d..5542d462b7 100644
--- a/util/system/compiler.h
+++ b/util/system/compiler.h
@@ -654,8 +654,8 @@ Y_FORCE_INLINE void DoNotOptimizeAway(T&& datum) {
}
/**
- * Use this macro to prevent unused variables elimination.
- */
+ * Use this macro to prevent unused variables elimination.
+ */
#define Y_DO_NOT_OPTIMIZE_AWAY(X) ::DoNotOptimizeAway(X)
#endif
diff --git a/util/system/shellcommand.h b/util/system/shellcommand.h
index c7637821e4..1b1f2bc927 100644
--- a/util/system/shellcommand.h
+++ b/util/system/shellcommand.h
@@ -184,35 +184,35 @@ public:
}
/**
- * @brief set if Finish() should be called on user-supplied streams
- * if process is run in async mode Finish will be called in process' thread
- * @param val if Finish() should be called
- * @return self
- */
+ * @brief set if Finish() should be called on user-supplied streams
+ * if process is run in async mode Finish will be called in process' thread
+ * @param val if Finish() should be called
+ * @return self
+ */
inline TShellCommandOptions& SetCloseStreams(bool val) {
CloseStreams = val;
return *this;
}
/**
- * @brief set if input stream should be closed after all data is read
- * call SetCloseInput(false) for interactive process
- * @param val if input stream should be closed
- * @return self
- */
+ * @brief set if input stream should be closed after all data is read
+ * call SetCloseInput(false) for interactive process
+ * @param val if input stream should be closed
+ * @return self
+ */
inline TShellCommandOptions& SetCloseInput(bool val) {
ShouldCloseInput.store(val);
return *this;
}
/**
- * @brief set if command should be interpreted by OS shell (/bin/sh or cmd.exe)
- * shell is enabled by default
- * call SetUseShell(false) for command to be sent to OS verbatim
- * @note shell operators > < | && || will not work if this option is off
- * @param useShell if command should be run in shell
- * @return self
- */
+ * @brief set if command should be interpreted by OS shell (/bin/sh or cmd.exe)
+ * shell is enabled by default
+ * call SetUseShell(false) for command to be sent to OS verbatim
+ * @note shell operators > < | && || will not work if this option is off
+ * @param useShell if command should be run in shell
+ * @return self
+ */
inline TShellCommandOptions& SetUseShell(bool useShell) {
UseShell = useShell;
if (!useShell)
@@ -246,7 +246,7 @@ public:
* @note currently ignored on windows
* @param detach if command should be run in new session
* @return self
- */
+ */
inline TShellCommandOptions& SetDetachSession(bool detach) {
DetachSession = detach;
return *this;
@@ -257,7 +257,7 @@ public:
* @note currently ignored on windows
* @param function function to be called after fork
* @return self
- */
+ */
inline TShellCommandOptions& SetFuncAfterFork(const std::function<void()>& function) {
FuncAfterFork = function;
return *this;
diff --git a/util/system/tempfile.h b/util/system/tempfile.h
index de249c129d..ac8bc5c322 100644
--- a/util/system/tempfile.h
+++ b/util/system/tempfile.h
@@ -43,7 +43,7 @@ private:
*
* Note, that the function is not race-free, the file is guaranteed to exist at the time the function returns, but not at the time the returned name is first used.
* Throws TSystemError on error.
- *
+ *
* Returned filepath has such format: dir/prefixXXXXXX.extension or dir/prefixXXXXXX
* But win32: dir/preXXXX.tmp (prefix is up to 3 characters, extension is always tmp).
*/
diff --git a/util/thread/pool.h b/util/thread/pool.h
index d1ea3a67cb..7c97880c6f 100644
--- a/util/thread/pool.h
+++ b/util/thread/pool.h
@@ -271,9 +271,9 @@ public:
bool Add(IObjectInQueue* obj) override Y_WARN_UNUSED_RESULT;
/**
- * @param queueSizeLimit means "unlimited" when = 0
- * @param threadCount means "single thread" when = 0
- */
+ * @param queueSizeLimit means "unlimited" when = 0
+ * @param threadCount means "single thread" when = 0
+ */
void Start(size_t threadCount, size_t queueSizeLimit = 0) override;
void Stop() noexcept override;
size_t Size() const noexcept override;