2 * Copyright (C) 2005-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
24 #include "AddonString.h"
28 // This is a hack in order to handle int's as strings. The correct fix for
29 // this is to get rid of Alternative all togther and make the codegenerator
30 // finally handle overloading correctly.
31 typedef String StringOrInt;
34 * This is a bit of a hack for dynamically typed languages. In somce
35 * cases python addon api calls handle dictionaries with variable
36 * value types. In this case we coerce all of these types into
37 * strings and then convert them back in the api. Yes, this is messy
38 * and maybe we should use the CVariant here. But for now the
39 * native api handles these calls by converting the string to the
42 template<class T> class Dictionary : public std::map<String,T> {};
44 typedef Dictionary<StringOrInt> Properties;