OmniSciDB  085a039ca4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
foreign_storage::anonymous_namespace{AbstractFileStorageDataWrapper.cpp} Namespace Reference

Functions

std::string append_file_path (const std::optional< std::string > &base, const std::optional< std::string > &subdirectory)
 
void throw_file_path_error (const std::string_view &missing_path, const std::string &table_name, const std::string_view &file_path_key)
 

Function Documentation

std::string foreign_storage::anonymous_namespace{AbstractFileStorageDataWrapper.cpp}::append_file_path ( const std::optional< std::string > &  base,
const std::optional< std::string > &  subdirectory 
)

Definition at line 81 of file AbstractFileStorageDataWrapper.cpp.

References generate_TableFunctionsFactory_init::separator.

Referenced by foreign_storage::AbstractFileStorageDataWrapper::getFullFilePath().

82  {
83 #ifdef _WIN32
84  const std::wstring str_to_cov{boost::filesystem::path::preferred_separator};
85  using convert_type = std::codecvt_utf8<wchar_t>;
86  std::wstring_convert<convert_type, wchar_t> converter;
87  std::string separator = converter.to_bytes(str_to_cov);
88 #else
89  const std::string separator{boost::filesystem::path::preferred_separator};
90 #endif
91  return std::regex_replace(
92  (base ? *base + separator : "") + (subdirectory ? *subdirectory : ""),
93  std::regex{separator + "{2,}"},
94  separator);
95 }

+ Here is the caller graph for this function:

void foreign_storage::anonymous_namespace{AbstractFileStorageDataWrapper.cpp}::throw_file_path_error ( const std::string_view &  missing_path,
const std::string &  table_name,
const std::string_view &  file_path_key 
)

Definition at line 129 of file AbstractFileStorageDataWrapper.cpp.

Referenced by foreign_storage::AbstractFileStorageDataWrapper::validateFilePathOptionKey().

131  {
132  std::stringstream ss;
133  ss << "No file_path found for Foreign Table \"" << table_name
134  << "\". Table must have either set a \"" << file_path_key << "\" option, or its "
135  << "parent server must have set a \"" << missing_path << "\" option.";
136  throw std::runtime_error(ss.str());
137 }

+ Here is the caller graph for this function: