Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Support #83

Open
zBugi opened this issue Aug 2, 2023 · 0 comments
Open

Windows Support #83

zBugi opened this issue Aug 2, 2023 · 0 comments

Comments

@zBugi
Copy link

zBugi commented Aug 2, 2023

I tried to build and install it on windows.
there is just one mistake in Resource.cpp
which can be fixed through this otherwise the favicon and so on will be having a file path like "C:\dev\my-service\lib\oatpp-swagger\res/favicon-16x16.png" which cannot be load:


#ifdef _WIN32
  const char otapp_char_directory_separator = '\\';
  const String otapp_string_directory_separator("\\");
#else 
  const char otapp_char_directory_separator = '/';
  const String otapp_string_directory_separator = "/";
#endif  

Resources::Resources(const oatpp::String& resDir, bool streaming) {
  
  if(!resDir || resDir->size() == 0) {
    throw std::runtime_error("[oatpp::swagger::Resources::Resources()]: Invalid resDir path. Please specify full path to oatpp-swagger/res folder");
  }
  
  m_resDir = resDir;

  if(m_resDir->data()[m_resDir->size() - 1] != otapp_char_directory_separator) {
    m_resDir = m_resDir + otapp_string_directory_separator;
  }

  m_streaming = streaming;
}

I think it could be done even better with c++17 since there is a system path library included. But I haven't tried that yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant