yql_paths.cpp 491 B

1234567891011121314151617181920212223
  1. #include "yql_paths.h"
  2. #include <util/folder/pathsplit.h>
  3. namespace NYql {
  4. TString BuildTablePath(TStringBuf prefixPath, TStringBuf path) {
  5. if (prefixPath.empty()) {
  6. return TString(path);
  7. }
  8. prefixPath.SkipPrefix("//");
  9. TPathSplitUnix prefixPathSplit(prefixPath);
  10. TPathSplitUnix pathSplit(path);
  11. if (pathSplit.IsAbsolute) {
  12. return TString(path);
  13. }
  14. return prefixPathSplit.AppendMany(pathSplit.begin(), pathSplit.end()).Reconstruct();
  15. }
  16. }