aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/utils/yql_paths.cpp
blob: cc7dd29bfbe2838943381962dc39dd4859d29cad (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
#include "yql_paths.h"

#include <util/folder/pathsplit.h>

namespace NYql {

TString BuildTablePath(TStringBuf prefixPath, TStringBuf path) {
    if (prefixPath.empty()) {
        return TString(path);
    }
    prefixPath.SkipPrefix("//");

    TPathSplitUnix prefixPathSplit(prefixPath);
    TPathSplitUnix pathSplit(path);

    if (pathSplit.IsAbsolute) {
        return TString(path);
    }

    return prefixPathSplit.AppendMany(pathSplit.begin(), pathSplit.end()).Reconstruct();
}

}