1 /*
2  *  Copyright (C) 2018-2020 Garrett Brown
3  *  Copyright (C) 2018-2020 Team Kodi
4  *
5  *  SPDX-License-Identifier: GPL-2.0-or-later
6  *  See LICENSE.md for more information.
7  */
8 
9 #pragma once
10 
11 #include <string>
12 #include <vector>
13 
14 namespace JOYSTICK
15 {
16   class CStringRegistry
17   {
18   public:
19     CStringRegistry() = default;
20 
21     unsigned int RegisterString(const std::string& str);
22 
23     const std::string &GetString(unsigned int handle);
24 
25   private:
26     bool FindString(const std::string &str, unsigned int &handle) const;
27 
28     std::vector<std::string> m_strings;
29   };
30 }
31