resource.h 601 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include <util/generic/string.h>
  3. #include <util/generic/strbuf.h>
  4. #include <util/generic/vector.h>
  5. namespace NResource {
  6. struct TResource {
  7. TStringBuf Key;
  8. TString Data;
  9. };
  10. typedef TVector<TResource> TResources;
  11. bool Has(const TStringBuf key);
  12. TString Find(const TStringBuf key);
  13. bool FindExact(const TStringBuf key, TString* out);
  14. /// @note Perform full scan for now.
  15. void FindMatch(const TStringBuf subkey, TResources* out);
  16. size_t Count() noexcept;
  17. TStringBuf KeyByIndex(size_t idx);
  18. TVector<TStringBuf> ListAllKeys();
  19. }