Skip to content

Commit

Permalink
OrcCommand: UtilitiesMain: remove OutputFileOption and OutputDirOption
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienfl-orc committed Nov 13, 2020
1 parent ae99bf1 commit c3e893d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 64 deletions.
38 changes: 0 additions & 38 deletions src/OrcCommand/UtilitiesMain.cpp
Expand Up @@ -204,44 +204,6 @@ bool UtilitiesMain::OutputOption(LPCWSTR szArg, LPCWSTR szOption, OutputSpec::Ki
return true;
}

bool UtilitiesMain::OutputFileOption(LPCWSTR szArg, LPCWSTR szOption, std::wstring& strOutputFile)
{
if (_wcsnicmp(szArg, szOption, wcslen(szOption)))
return false;

LPCWSTR pEquals = wcschr(szArg, L'=');
if (!pEquals)
{
Log::Error(L"Option /{} should be like: /{}=c:\\temp\\OutputFile.csv", szOption, szOption);
return false;
}
if (auto hr = GetOutputFile(pEquals + 1, strOutputFile, true); FAILED(hr))
{
Log::Error(L"Invalid output dir specified: {}", pEquals + 1);
return false;
}
return true;
}

bool UtilitiesMain::OutputDirOption(LPCWSTR szArg, LPCWSTR szOption, std::wstring& strOutputDir)
{
if (_wcsnicmp(szArg, szOption, wcslen(szOption)))
return false;

LPCWSTR pEquals = wcschr(szArg, L'=');
if (!pEquals)
{
Log::Error(L"Option /{} should be like: /{}=c:\\temp", szOption, szOption);
return false;
}
if (auto hr = GetOutputDir(pEquals + 1, strOutputDir, true); FAILED(hr))
{
Log::Error(L"Invalid output dir specified: {}", pEquals + 1);
return false;
}
return true;
}

bool UtilitiesMain::InputFileOption(LPCWSTR szArg, LPCWSTR szOption, std::wstring& strOutputFile)
{
if (_wcsnicmp(szArg, szOption, wcslen(szOption)))
Expand Down
26 changes: 0 additions & 26 deletions src/OrcCommand/UtilitiesMain.h
Expand Up @@ -577,32 +577,6 @@ class ORCLIB_API UtilitiesMain
return false;
}

bool OutputFileOption(LPCWSTR szArg, LPCWSTR szOption, std::wstring& strOutputFile);
template <typename OptionType>
bool OutputFileOption(LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType> parameter)
{
OptionType result;
if (OutputFileOption(szArg, szOption, result))
{
parameter.emplace(std::move(result));
return true;
}
return false;
}

bool OutputDirOption(LPCWSTR szArg, LPCWSTR szOption, std::wstring& strOutputFile);
template <typename OptionType>
bool OutputDirOption(LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType>& parameter)
{
OptionType result;
if (OutputDirOption(szArg, szOption, result))
{
parameter.emplace(std::move(result));
return true;
}
return false;
}

bool InputFileOption(LPCWSTR szArg, LPCWSTR szOption, std::wstring& strInputFile);
template <typename OptionType>
bool InputFileOption(LPCWSTR szArg, LPCWSTR szOption, std::optional<OptionType>& parameter)
Expand Down

0 comments on commit c3e893d

Please sign in to comment.