aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/resource/resource.h
blob: 335074104a267e57aa3592b8bf92ee959ac1c8ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include <util/generic/string.h>
#include <util/generic/strbuf.h>
#include <util/generic/vector.h>

namespace NResource {
    struct TResource {
        TStringBuf Key;
        TString Data;
    };

    typedef TVector<TResource> TResources;

    bool Has(const TStringBuf key);
    TString Find(const TStringBuf key);
    bool FindExact(const TStringBuf key, TString* out);
    /// @note Perform full scan for now.
    void FindMatch(const TStringBuf subkey, TResources* out);
    size_t Count() noexcept;
    TStringBuf KeyByIndex(size_t idx);
    TVector<TStringBuf> ListAllKeys();
}