diff options
| author | tldr <[email protected]> | 2022-02-10 16:50:18 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:50:18 +0300 | 
| commit | 42d219fbd63ee173b0cb7db1b26a3ec615f0bb71 (patch) | |
| tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp | |
| parent | fb217752f4b5a81abe9df05e38c5a71d080fc2a8 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp')
| -rw-r--r-- | library/cpp/cache/cache.h | 182 | ||||
| -rw-r--r-- | library/cpp/cache/ut/cache_ut.cpp | 134 | ||||
| -rw-r--r-- | library/cpp/getopt/small/completion_generator.cpp | 4 | ||||
| -rw-r--r-- | library/cpp/getopt/small/modchooser.cpp | 32 | ||||
| -rw-r--r-- | library/cpp/getopt/small/modchooser.h | 12 | 
5 files changed, 182 insertions, 182 deletions
| diff --git a/library/cpp/cache/cache.h b/library/cpp/cache/cache.h index 2314b588eac..6dc997076d9 100644 --- a/library/cpp/cache/cache.h +++ b/library/cpp/cache/cache.h @@ -8,26 +8,26 @@  #include <util/generic/yexception.h>  #include <utility> -template <class TValue>  -struct TUniformSizeProvider {  -    size_t operator()(const TValue&) {  -        return 1;  -    }  -};  -  -template <typename TKey, typename TValue, class TSizeProvider = TUniformSizeProvider<TValue>>  +template <class TValue> +struct TUniformSizeProvider { +    size_t operator()(const TValue&) { +        return 1; +    } +}; + +template <typename TKey, typename TValue, class TSizeProvider = TUniformSizeProvider<TValue>>  class TLRUList {  public: -    TLRUList(size_t maxSize, const TSizeProvider& sizeProvider = TSizeProvider())  +    TLRUList(size_t maxSize, const TSizeProvider& sizeProvider = TSizeProvider())          : List() -        , SizeProvider(sizeProvider)  -        , ItemsAmount(0)  -        , TotalSize(0)  +        , SizeProvider(sizeProvider) +        , ItemsAmount(0) +        , TotalSize(0)          , MaxSize(maxSize)      {      } -public:  +public:      struct TItem: public TIntrusiveListItem<TItem> {          typedef TIntrusiveListItem<TItem> TBase;          TItem(const TKey& key, const TValue& value = TValue()) @@ -65,15 +65,15 @@ public:  public:      TItem* Insert(TItem* item) {          List.PushBack(item); -        ++ItemsAmount;  -        TotalSize += SizeProvider(item->Value);  -  -        return RemoveIfOverflown();  -    }  -  -    TItem* RemoveIfOverflown() {  +        ++ItemsAmount; +        TotalSize += SizeProvider(item->Value); + +        return RemoveIfOverflown(); +    } + +    TItem* RemoveIfOverflown() {          TItem* deleted = nullptr; -        if (TotalSize > MaxSize && ItemsAmount > 1) {  +        if (TotalSize > MaxSize && ItemsAmount > 1) {              deleted = GetOldest();              Erase(deleted);          } @@ -88,8 +88,8 @@ public:      void Erase(TItem* item) {          item->Unlink(); -        --ItemsAmount;  -        TotalSize -= SizeProvider(item->Value);  +        --ItemsAmount; +        TotalSize -= SizeProvider(item->Value);      }      void Promote(TItem* item) { @@ -98,7 +98,7 @@ public:      }      size_t GetSize() const { -        return ItemsAmount;  +        return ItemsAmount;      }      size_t GetTotalSize() const { @@ -118,9 +118,9 @@ public:  private:      typedef TIntrusiveList<TItem> TListType;      TListType List; -    TSizeProvider SizeProvider;  -    size_t ItemsAmount;  -    size_t TotalSize;  +    TSizeProvider SizeProvider; +    size_t ItemsAmount; +    size_t TotalSize;      size_t MaxSize;  }; @@ -175,11 +175,11 @@ public:      TItem* Insert(TItem* item) {          List.PushBack(item); // give a chance for promotion          ++ListSize; -  -        return RemoveIfOverflown();  -    }  -  -    TItem* RemoveIfOverflown() {  + +        return RemoveIfOverflown(); +    } + +    TItem* RemoveIfOverflown() {          TItem* deleted = nullptr;          if (ListSize > MaxSize) {              deleted = GetLeastFrequentlyUsed(); @@ -283,35 +283,35 @@ public:  public:      TItem* Insert(TItem* item) { -        FixHeap();  -  -        if (Size >= MaxSize && item->Weight < GetLightest()->Weight) {  -            return item;  -        }  -  -        Heap.push_back(item);  -        PushHeap(Heap.begin(), Heap.end(), THeapComparator());  -        ++Size;  -  -        return RemoveIfOverflown();  -    }  -  -    TItem* RemoveIfOverflown() {  -        if (Size <= MaxSize) {  +        FixHeap(); + +        if (Size >= MaxSize && item->Weight < GetLightest()->Weight) { +            return item; +        } + +        Heap.push_back(item); +        PushHeap(Heap.begin(), Heap.end(), THeapComparator()); +        ++Size; + +        return RemoveIfOverflown(); +    } + +    TItem* RemoveIfOverflown() { +        if (Size <= MaxSize) {              return nullptr;          } -  -        auto lightest = GetLightest();  -        Erase(lightest);  -        PopHeap(Heap.begin(), Heap.end(), THeapComparator());  -        return lightest;  + +        auto lightest = GetLightest(); +        Erase(lightest); +        PopHeap(Heap.begin(), Heap.end(), THeapComparator()); +        return lightest;      }      TItem* GetLightest() { -        FixHeap();  -  +        FixHeap(); +          Y_ASSERT(!Heap.empty()); -  +          return Heap.front();      } @@ -320,16 +320,16 @@ public:      // and will be deleted on-access (using FixHeap method)      void Erase(TItem* item) {          Y_ASSERT(Size > 0); -  +          --Size; -        Removed.insert(item);  +        Removed.insert(item);      }      void Promote(TItem*) {          // do nothing      } -    [[nodiscard]] size_t GetSize() const {  +    [[nodiscard]] size_t GetSize() const {          return Size;      } @@ -349,20 +349,20 @@ public:          Size = 0;      } -private:  +private:      // Physically remove erased elements from the heap      void FixHeap() { -        if (Removed.empty()) {  -            return;  +        if (Removed.empty()) { +            return;          } -  -        Heap.erase(std::remove_if(Heap.begin(), Heap.end(), [this](TItem* item) {  -                       return this->Removed.contains(item);  -                   }),  -                   Heap.end());  -        MakeHeap(Heap.begin(), Heap.end(), THeapComparator());  -        Removed.clear();  -        Size = Heap.size();  + +        Heap.erase(std::remove_if(Heap.begin(), Heap.end(), [this](TItem* item) { +                       return this->Removed.contains(item); +                   }), +                   Heap.end()); +        MakeHeap(Heap.begin(), Heap.end(), THeapComparator()); +        Removed.clear(); +        Size = Heap.size();      }  private: @@ -424,9 +424,9 @@ public:          TIndexConstIterator Iter;      }; -    TCache(TListType&& list, bool multiValue = false)  +    TCache(TListType&& list, bool multiValue = false)          : Index() -        , List(std::move(list))  +        , List(std::move(list))          , MultiValue(multiValue)      {      } @@ -482,18 +482,18 @@ public:          TIndexIterator it = Index.insert(tmpItem);          TItem* insertedItem = const_cast<TItem*>(&*it); -        auto removedItem = List.Insert(insertedItem);  -        auto insertedWasRemoved = removedItem == insertedItem;  +        auto removedItem = List.Insert(insertedItem); +        auto insertedWasRemoved = removedItem == insertedItem;          if (removedItem) {              EraseFromIndex(removedItem); -            while ((removedItem = List.RemoveIfOverflown())) {  -                insertedWasRemoved = insertedWasRemoved || insertedItem == removedItem;  -                EraseFromIndex(removedItem);  -            }  +            while ((removedItem = List.RemoveIfOverflown())) { +                insertedWasRemoved = insertedWasRemoved || insertedItem == removedItem; +                EraseFromIndex(removedItem); +            }          }          Y_ASSERT(Index.size() == List.GetSize()); -        return !insertedWasRemoved;  +        return !insertedWasRemoved;      }      void Update(const TKey& key, const TValue& value) { @@ -574,20 +574,20 @@ struct TNoopDelete {      }  }; -template <typename TKey, typename TValue, typename TDeleter = TNoopDelete, class TSizeProvider = TUniformSizeProvider<TValue>>  -class TLRUCache: public TCache<TKey, TValue, TLRUList<TKey, TValue, TSizeProvider>, TDeleter> {  -    using TListType = TLRUList<TKey, TValue, TSizeProvider>;  -    typedef TCache<TKey, TValue, TListType, TDeleter> TBase;  +template <typename TKey, typename TValue, typename TDeleter = TNoopDelete, class TSizeProvider = TUniformSizeProvider<TValue>> +class TLRUCache: public TCache<TKey, TValue, TLRUList<TKey, TValue, TSizeProvider>, TDeleter> { +    using TListType = TLRUList<TKey, TValue, TSizeProvider>; +    typedef TCache<TKey, TValue, TListType, TDeleter> TBase;  public: -    TLRUCache(size_t maxSize, bool multiValue = false, const TSizeProvider& sizeProvider = TSizeProvider())  -        : TBase(TListType(maxSize, sizeProvider), multiValue)  +    TLRUCache(size_t maxSize, bool multiValue = false, const TSizeProvider& sizeProvider = TSizeProvider()) +        : TBase(TListType(maxSize, sizeProvider), multiValue)      {      } -public:  -    typedef typename TBase::TIterator TIterator;  -  +public: +    typedef typename TBase::TIterator TIterator; +      TValue& GetOldest() {          return TBase::List.GetOldest()->Value;      } @@ -604,13 +604,13 @@ public:  template <typename TKey, typename TValue, typename TDeleter = TNoopDelete>  class TLFUCache: public TCache<TKey, TValue, TLFUList<TKey, TValue>, TDeleter> {      typedef TCache<TKey, TValue, TLFUList<TKey, TValue>, TDeleter> TBase; -    using TListType = TLFUList<TKey, TValue>;  +    using TListType = TLFUList<TKey, TValue>;  public:      typedef typename TBase::TIterator TIterator;      TLFUCache(size_t maxSize, bool multiValue = false) -        : TBase(TListType(maxSize), multiValue)  +        : TBase(TListType(maxSize), multiValue)      {      } @@ -629,13 +629,13 @@ public:  template <typename TKey, typename TValue, typename TWeight, typename TWeighter, typename TDeleter = TNoopDelete>  class TLWCache: public TCache<TKey, TValue, TLWList<TKey, TValue, TWeight, TWeighter>, TDeleter> {      typedef TCache<TKey, TValue, TLWList<TKey, TValue, TWeight, TWeighter>, TDeleter> TBase; -    using TListType = TLWList<TKey, TValue, TWeight, TWeighter>;  +    using TListType = TLWList<TKey, TValue, TWeight, TWeighter>;  public:      typedef typename TBase::TIterator TIterator;      TLWCache(size_t maxSize, bool multiValue = false) -        : TBase(TListType(maxSize), multiValue)  +        : TBase(TListType(maxSize), multiValue)      {      } diff --git a/library/cpp/cache/ut/cache_ut.cpp b/library/cpp/cache/ut/cache_ut.cpp index 886afecb883..329872cfdee 100644 --- a/library/cpp/cache/ut/cache_ut.cpp +++ b/library/cpp/cache/ut/cache_ut.cpp @@ -29,42 +29,42 @@ Y_UNIT_TEST_SUITE(TCacheTest) {          UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 1);      } -    Y_UNIT_TEST(LRUListWeightedTest) {  -        typedef TLRUList<int, TString, size_t (*)(const TString&)> TListType;  -        TListType list(7, [](auto& string) {  -            return string.size();  -        });  -  -        TListType::TItem x1(1, "ttt");  -        list.Insert(&x1);  -        while (list.RemoveIfOverflown()) {  -        }  -        UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 1);  -  -        TListType::TItem x2(2, "yyy");  -        list.Insert(&x2);  -        while (list.RemoveIfOverflown()) {  -        }  -        UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 1);  -  -        list.Promote(list.GetOldest());  -        while (list.RemoveIfOverflown()) {  -        }  -        UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 2);  -  -        TListType::TItem x3(3, "zzz");  -        list.Insert(&x3);  -        while (list.RemoveIfOverflown()) {  -        }  -        UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 1);  -  -        TListType::TItem x4(4, "longlong");  -        list.Insert(&x4);  -        while (list.RemoveIfOverflown()) {  -        }  -        UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 4);  -    }  -  +    Y_UNIT_TEST(LRUListWeightedTest) { +        typedef TLRUList<int, TString, size_t (*)(const TString&)> TListType; +        TListType list(7, [](auto& string) { +            return string.size(); +        }); + +        TListType::TItem x1(1, "ttt"); +        list.Insert(&x1); +        while (list.RemoveIfOverflown()) { +        } +        UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 1); + +        TListType::TItem x2(2, "yyy"); +        list.Insert(&x2); +        while (list.RemoveIfOverflown()) { +        } +        UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 1); + +        list.Promote(list.GetOldest()); +        while (list.RemoveIfOverflown()) { +        } +        UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 2); + +        TListType::TItem x3(3, "zzz"); +        list.Insert(&x3); +        while (list.RemoveIfOverflown()) { +        } +        UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 1); + +        TListType::TItem x4(4, "longlong"); +        list.Insert(&x4); +        while (list.RemoveIfOverflown()) { +        } +        UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 4); +    } +      Y_UNIT_TEST(LFUListTest) {          typedef TLFUList<int, TString> TListType;          TListType list(2); @@ -141,37 +141,37 @@ Y_UNIT_TEST_SUITE(TCacheTest) {          UNIT_ASSERT(s.Find(3) == s.End());      } -    Y_UNIT_TEST(LRUWithCustomSizeProviderTest) {  -        typedef TLRUCache<int, TString, TNoopDelete, size_t(*)(const TString&)> TCache;  -        TCache s(10, false, [](auto& string) { return string.size(); }); // size 10  -        s.Insert(1, "abcd");  -        UNIT_ASSERT(s.Find(1) != s.End());  -        UNIT_ASSERT_EQUAL(*s.Find(1), "abcd");  -        s.Insert(2, "defg");  -        UNIT_ASSERT(s.GetOldest() == "abcd");  -        s.Insert(3, "2c");  -        UNIT_ASSERT(s.GetOldest() == "abcd");  -        s.Insert(4, "hjkl");  -        UNIT_ASSERT(s.GetOldest() == "defg");  -        // key 1 will be deleted  -        UNIT_ASSERT(s.Find(1) == s.End());  -        UNIT_ASSERT(s.Find(2) != s.End());  -        UNIT_ASSERT(*s.Find(2) == "defg");  -        UNIT_ASSERT(s.Find(3) != s.End());  -        UNIT_ASSERT(*s.Find(3) == "2c");  -        UNIT_ASSERT(s.Find(4) != s.End());  -        UNIT_ASSERT(*s.Find(4) == "hjkl");  -  -        UNIT_ASSERT(!s.Insert(3, "abcd"));  -        UNIT_ASSERT(*s.Find(3) == "2c");  -        s.Update(3, "abcd");  -        UNIT_ASSERT(*s.Find(3) == "abcd");  -  -        TCache::TIterator it = s.Find(3);  -        s.Erase(it);  -        UNIT_ASSERT(s.Find(3) == s.End());  -    }  -  +    Y_UNIT_TEST(LRUWithCustomSizeProviderTest) { +        typedef TLRUCache<int, TString, TNoopDelete, size_t(*)(const TString&)> TCache; +        TCache s(10, false, [](auto& string) { return string.size(); }); // size 10 +        s.Insert(1, "abcd"); +        UNIT_ASSERT(s.Find(1) != s.End()); +        UNIT_ASSERT_EQUAL(*s.Find(1), "abcd"); +        s.Insert(2, "defg"); +        UNIT_ASSERT(s.GetOldest() == "abcd"); +        s.Insert(3, "2c"); +        UNIT_ASSERT(s.GetOldest() == "abcd"); +        s.Insert(4, "hjkl"); +        UNIT_ASSERT(s.GetOldest() == "defg"); +        // key 1 will be deleted +        UNIT_ASSERT(s.Find(1) == s.End()); +        UNIT_ASSERT(s.Find(2) != s.End()); +        UNIT_ASSERT(*s.Find(2) == "defg"); +        UNIT_ASSERT(s.Find(3) != s.End()); +        UNIT_ASSERT(*s.Find(3) == "2c"); +        UNIT_ASSERT(s.Find(4) != s.End()); +        UNIT_ASSERT(*s.Find(4) == "hjkl"); + +        UNIT_ASSERT(!s.Insert(3, "abcd")); +        UNIT_ASSERT(*s.Find(3) == "2c"); +        s.Update(3, "abcd"); +        UNIT_ASSERT(*s.Find(3) == "abcd"); + +        TCache::TIterator it = s.Find(3); +        s.Erase(it); +        UNIT_ASSERT(s.Find(3) == s.End()); +    } +      Y_UNIT_TEST(LRUSetMaxSizeTest) {          typedef TLRUCache<int, TString> TCache;          TCache s(2); // size 2 diff --git a/library/cpp/getopt/small/completion_generator.cpp b/library/cpp/getopt/small/completion_generator.cpp index 3e8a5302b47..ac41988217e 100644 --- a/library/cpp/getopt/small/completion_generator.cpp +++ b/library/cpp/getopt/small/completion_generator.cpp @@ -453,7 +453,7 @@ namespace NLastGetopt {                  auto& line = L << "COMPREPLY+=( $(compgen -W '";                  TStringBuf sep = "";                  for (auto& mode : modes) { -                    if (!mode->Hidden && !mode->NoCompletion) {  +                    if (!mode->Hidden && !mode->NoCompletion) {                          line << sep << B(mode->Name);                          sep = " ";                      } @@ -470,7 +470,7 @@ namespace NLastGetopt {                  I;                  for (auto& mode : modes) { -                    if (mode->Name.empty() || mode->Hidden || mode->NoCompletion) {  +                    if (mode->Name.empty() || mode->Hidden || mode->NoCompletion) {                          continue;                      } diff --git a/library/cpp/getopt/small/modchooser.cpp b/library/cpp/getopt/small/modchooser.cpp index 3e37a768e1e..2fa5cfd0703 100644 --- a/library/cpp/getopt/small/modchooser.cpp +++ b/library/cpp/getopt/small/modchooser.cpp @@ -60,12 +60,12 @@ private:      TMainClassV* Main;  }; -TModChooser::TMode::TMode(const TString& name, TMainClass* main, const TString& descr, bool hidden, bool noCompletion)  +TModChooser::TMode::TMode(const TString& name, TMainClass* main, const TString& descr, bool hidden, bool noCompletion)      : Name(name)      , Main(main)      , Description(descr)      , Hidden(hidden) -    , NoCompletion(noCompletion)  +    , NoCompletion(noCompletion)  {  } @@ -80,25 +80,25 @@ TModChooser::TModChooser()  TModChooser::~TModChooser() = default; -void TModChooser::AddMode(const TString& mode, const TMainFunctionRawPtr func, const TString& description, bool hidden, bool noCompletion) {  -    AddMode(mode, TMainFunctionPtr(func), description, hidden, noCompletion);  +void TModChooser::AddMode(const TString& mode, const TMainFunctionRawPtr func, const TString& description, bool hidden, bool noCompletion) { +    AddMode(mode, TMainFunctionPtr(func), description, hidden, noCompletion);  } -void TModChooser::AddMode(const TString& mode, const TMainFunctionRawPtrV func, const TString& description, bool hidden, bool noCompletion) {  -    AddMode(mode, TMainFunctionPtrV(func), description, hidden, noCompletion);  +void TModChooser::AddMode(const TString& mode, const TMainFunctionRawPtrV func, const TString& description, bool hidden, bool noCompletion) { +    AddMode(mode, TMainFunctionPtrV(func), description, hidden, noCompletion);  } -void TModChooser::AddMode(const TString& mode, const TMainFunctionPtr func, const TString& description, bool hidden, bool noCompletion) {  +void TModChooser::AddMode(const TString& mode, const TMainFunctionPtr func, const TString& description, bool hidden, bool noCompletion) {      Wrappers.push_back(MakeHolder<PtrWrapper>(func)); -    AddMode(mode, Wrappers.back().Get(), description, hidden, noCompletion);  +    AddMode(mode, Wrappers.back().Get(), description, hidden, noCompletion);  } -void TModChooser::AddMode(const TString& mode, const TMainFunctionPtrV func, const TString& description, bool hidden, bool noCompletion) {  +void TModChooser::AddMode(const TString& mode, const TMainFunctionPtrV func, const TString& description, bool hidden, bool noCompletion) {      Wrappers.push_back(MakeHolder<PtrvWrapper>(func)); -    AddMode(mode, Wrappers.back().Get(), description, hidden, noCompletion);  +    AddMode(mode, Wrappers.back().Get(), description, hidden, noCompletion);  } -void TModChooser::AddMode(const TString& mode, TMainClass* func, const TString& description, bool hidden, bool noCompletion) {  +void TModChooser::AddMode(const TString& mode, TMainClass* func, const TString& description, bool hidden, bool noCompletion) {      if (Modes.FindPtr(mode)) {          ythrow yexception() << "TMode '" << mode << "' already exists in TModChooser.";      } @@ -106,12 +106,12 @@ void TModChooser::AddMode(const TString& mode, TMainClass* func, const TString&      Modes[mode] = UnsortedModes.emplace_back(MakeHolder<TMode>(mode, func, description, hidden, noCompletion)).Get();  } -void TModChooser::AddMode(const TString& mode, TMainClassV* func, const TString& description, bool hidden, bool noCompletion) {  +void TModChooser::AddMode(const TString& mode, TMainClassV* func, const TString& description, bool hidden, bool noCompletion) {      Wrappers.push_back(MakeHolder<ClassWrapper>(func)); -    AddMode(mode, Wrappers.back().Get(), description, hidden, noCompletion);  +    AddMode(mode, Wrappers.back().Get(), description, hidden, noCompletion);  } -void TModChooser::AddGroupModeDescription(const TString& description, bool hidden, bool noCompletion) {  +void TModChooser::AddGroupModeDescription(const TString& description, bool hidden, bool noCompletion) {      UnsortedModes.push_back(MakeHolder<TMode>(TString(), nullptr, description.data(), hidden, noCompletion));  } @@ -156,10 +156,10 @@ void TModChooser::DisableSvnRevisionOption() {      SvnRevisionOptionDisabled = true;  } -void TModChooser::AddCompletions(TString progName, const TString& name, bool hidden, bool noCompletion) {  +void TModChooser::AddCompletions(TString progName, const TString& name, bool hidden, bool noCompletion) {      if (CompletionsGenerator == nullptr) {          CompletionsGenerator = NLastGetopt::MakeCompletionMod(this, std::move(progName), name); -        AddMode(name, CompletionsGenerator.Get(), "generate autocompletion files", hidden, noCompletion);  +        AddMode(name, CompletionsGenerator.Get(), "generate autocompletion files", hidden, noCompletion);      }  } diff --git a/library/cpp/getopt/small/modchooser.h b/library/cpp/getopt/small/modchooser.h index 2b9cf2246bd..0a8de6d50b5 100644 --- a/library/cpp/getopt/small/modchooser.h +++ b/library/cpp/getopt/small/modchooser.h @@ -51,11 +51,11 @@ public:      void AddMode(const TString& mode, TMainFunctionRawPtrV func, const TString& description, bool hidden = false, bool noCompletion = false);      void AddMode(const TString& mode, TMainFunctionPtr func, const TString& description, bool hidden = false, bool noCompletion = false);      void AddMode(const TString& mode, TMainFunctionPtrV func, const TString& description, bool hidden = false, bool noCompletion = false); -    void AddMode(const TString& mode, TMainClass* func, const TString& description, bool hidden = false, bool noCompletion = false);  -    void AddMode(const TString& mode, TMainClassV* func, const TString& description, bool hidden = false, bool noCompletion = false);  +    void AddMode(const TString& mode, TMainClass* func, const TString& description, bool hidden = false, bool noCompletion = false); +    void AddMode(const TString& mode, TMainClassV* func, const TString& description, bool hidden = false, bool noCompletion = false);      //! Hidden groups won't be displayed in 'help' block -    void AddGroupModeDescription(const TString& description, bool hidden = false, bool noCompletion = false);  +    void AddGroupModeDescription(const TString& description, bool hidden = false, bool noCompletion = false);      //! Set default mode (if not specified explicitly)      void SetDefaultMode(const TString& mode); @@ -82,7 +82,7 @@ public:      void DisableSvnRevisionOption(); -    void AddCompletions(TString progName, const TString& name = "completion", bool hidden = false, bool noCompletion = false);  +    void AddCompletions(TString progName, const TString& name = "completion", bool hidden = false, bool noCompletion = false);      /*! Run appropriate mode.       * @@ -107,7 +107,7 @@ public:          TMainClass* Main;          TString Description;          bool Hidden; -        bool NoCompletion;  +        bool NoCompletion;          TVector<TString> Aliases;          TMode() @@ -115,7 +115,7 @@ public:          {          } -        TMode(const TString& name, TMainClass* main, const TString& descr, bool hidden, bool noCompletion);  +        TMode(const TString& name, TMainClass* main, const TString& descr, bool hidden, bool noCompletion);          // Full name includes primary name and aliases. Also, will add ANSI colors.          size_t CalculateFullNameLen() const; | 
