/* Copyright (C) 2013 * swift project Community / Contributors * * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, * including this file, may be copied, modified, propagated, or distributed except according to the terms * contained in the LICENSE file. */ //! \file #ifndef BLACKMISC_CONTAINERBASE_H #define BLACKMISC_CONTAINERBASE_H #include "range.h" #include "propertyindexvariantmap.h" #include "blackmiscfreefunctions.h" #include "predicates.h" #include "json.h" #include namespace BlackMisc { //! Class providing static helper methods for different containers class CContainerHelper { public: //! Stringify value object template static QString stringify(const U &obj, bool i18n) { return obj.toQString(i18n); } //! Stringify int static QString stringify(int n, bool i18n) { return i18n ? QLocale().toString(n) : QString::number(n); } //! Stringify uint static QString stringify(uint n, bool i18n) { return i18n ? QLocale().toString(n) : QString::number(n); } //! Stringify qlonglong static QString stringify(qlonglong n, bool i18n) { return i18n ? QLocale().toString(n) : QString::number(n); } //! Stringify qulonglong static QString stringify(qulonglong n, bool i18n) { return i18n ? QLocale().toString(n) : QString::number(n); } //! Stringify double static QString stringify(double n, bool i18n) { return i18n ? QLocale().toString(n) : QString::number(n); } //! Stringify QString static QString stringify(QString str, bool /*i18n*/) { return str; } }; // forward declaration template