aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/providers/common/udf_resolve/yql_files_box.h
blob: aac5f7ef196632e7374ccc2e29eadc63e7d950d4 (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
24
25
26
27
28
29
30
31
32
33
#pragma once

#include <yql/essentials/utils/rand_guid.h>

#include <util/generic/hash.h>
#include <util/folder/path.h>

namespace NYql {
namespace NCommon {

/*
  Resembles sandbox for external UDFs
*/
class TFilesBox {
public:
    TFilesBox(TFsPath dir, TRandGuid randGuid);
    ~TFilesBox();

    TString MakeLinkFrom(const TString& source, const TString& filename = {});
    TString GetDir() const;

    void Destroy();

private:
    TFsPath Dir_;
    TRandGuid RandGuid_;
    THashMap<TString, TString> Mapping_;
};

THolder<TFilesBox> CreateFilesBox(const TFsPath& baseDir);

}
}