FreeRDP
SDL2ResourceManager Class Reference

#include <sdl2_resource_manager.hpp>

Inheritance diagram for SDL2ResourceManager:
Collaboration diagram for SDL2ResourceManager:

Public Member Functions

 SDL2ResourceManager (const SDL2ResourceManager &other)=delete
 
 SDL2ResourceManager (const SDL2ResourceManager &&other)=delete
 
SDL2ResourceManageroperator= (const SDL2ResourceManager &other)=delete
 
SDL2ResourceManageroperator= (SDL2ResourceManager &&other)=delete
 
- Public Member Functions inherited from SDLResourceManager
 SDLResourceManager (const SDLResourceManager &other)=delete
 
 SDLResourceManager (const SDLResourceManager &&other)=delete
 
SDLResourceManager operator= (const SDLResourceManager &other)=delete
 
SDLResourceManageroperator= (SDLResourceManager &&other)=delete
 

Static Public Member Functions

static SDL_RWops * get (const std::string &type, const std::string &id)
 
- Static Public Member Functions inherited from SDLResourceManager
static std::string typeFonts ()
 
static std::string typeImages ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from SDLResourceManager
static void insert (const std::string &type, const std::string &id, const std::vector< unsigned char > &data)
 
static const std::vector< unsigned char > * data (const std::string &type, const std::string &id)
 
static std::string filename (const std::string &type, const std::string &id)
 
static bool useCompiledResources ()
 

Detailed Description

FreeRDP: A Remote Desktop Protocol Implementation

Copyright 2023 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition at line 27 of file sdl2_resource_manager.hpp.

Member Function Documentation

◆ get()

SDL_RWops * SDL2ResourceManager::get ( const std::string &  type,
const std::string &  id 
)
static

FreeRDP: A Remote Desktop Protocol Implementation

Copyright 2023 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition at line 21 of file sdl2_resource_manager.cpp.

22 {
23  if (useCompiledResources())
24  {
25  auto d = data(type, id);
26  if (!d)
27  return nullptr;
28 
29  auto s = d->size();
30  if (s > INT32_MAX)
31  return nullptr;
32  return SDL_RWFromConstMem(d->data(), static_cast<int>(s));
33  }
34 
35  auto name = filename(type, id);
36  return SDL_RWFromFile(name.c_str(), "rb");
37 }

The documentation for this class was generated from the following files: