Commit 0e16449e authored by Thomas Guillem's avatar Thomas Guillem Committed by Hugo Beauzée-Luyssen
Browse files

Revert "Provide a std::to_string replacement for android"

This reverts commit 02e563cb

.
Signed-off-by: Hugo Beauzée-Luyssen's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent d38c1c8c
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015 Hugo Beauzée-Luyssen, Videolabs
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#pragma once
#include <string>
#ifndef __ANDROID__
namespace medialibrary
{
template <typename T>
inline std::string toString(T t)
{
static_assert(std::is_fundamental<T>::value, "This only supports fundamental types");
return std::to_string(t);
}
}
#else
#include <sstream>
namespace medialibrary
{
template <typename T>
inline std::string toString(T t)
{
static_assert(std::is_fundamental<T>::value, "This only supports fundamental types");
std::ostringstream ss;
ss << std::forward<T>(t);
return ss.str();
}
}
#endif
......@@ -27,7 +27,6 @@
#include "History.h"
#include "database/SqliteTools.h"
#include "ToString.h"
namespace medialibrary
{
......@@ -64,7 +63,7 @@ bool History::createTable( DBConnection dbConnection )
" BEGIN "
"DELETE FROM " + policy::HistoryTable::Name + " WHERE id_record in "
"(SELECT id_record FROM " + policy::HistoryTable::Name +
" ORDER BY insertion_date DESC LIMIT -1 OFFSET " + toString( MaxEntries ) + ");"
" ORDER BY insertion_date DESC LIMIT -1 OFFSET " + std::to_string( MaxEntries ) + ");"
" END";
return sqlite::Tools::executeRequest( dbConnection, req ) &&
sqlite::Tools::executeRequest( dbConnection, triggerReq );
......
......@@ -24,7 +24,6 @@
#include <string>
#include <exception>
#include "ToString.h"
namespace medialibrary
{
......@@ -56,8 +55,8 @@ class ColumnOutOfRange : public std::exception
public:
ColumnOutOfRange( unsigned int idx, unsigned int nbColumns )
{
m_reason = "Attempting to extract column at index " + toString( idx ) +
" from a request with " + toString( nbColumns ) + " columns";
m_reason = "Attempting to extract column at index " + std::to_string( idx ) +
" from a request with " + std::to_string( nbColumns ) + " columns";
}
virtual const char* what() const noexcept override
......
......@@ -32,7 +32,6 @@
#include "Genre.h"
#include "Media.h"
#include "Show.h"
#include "ToString.h"
#include "utils/Filename.h"
#include "utils/ModificationsNotifier.h"
#include <cstdlib>
......@@ -327,7 +326,7 @@ std::shared_ptr<AlbumTrack> MetadataParser::handleTrack( std::shared_ptr<Album>
if ( task.trackNumber != 0 )
{
title = "Track #";
title += toString( task.trackNumber );
title += std::to_string( task.trackNumber );
}
}
if ( title.empty() == false )
......
......@@ -31,7 +31,6 @@
#include "logging/Logger.h"
#include "MediaLibrary.h"
#include "utils/VLCInstance.h"
#include "ToString.h"
#ifdef HAVE_JPEG
#include "imagecompressors/JpegCompressor.h"
......@@ -232,7 +231,7 @@ parser::Task::Status VLCThumbnailer::compress( std::shared_ptr<Media> media, std
{
auto path = m_ml->thumbnailPath();
path += "/";
path += toString( media->id() ) + "." + m_compressor->extension();
path += std::to_string( media->id() ) + "." + m_compressor->extension();
auto hOffset = m_width > DesiredWidth ? ( m_width - DesiredWidth ) / 2 : 0;
auto vOffset = m_height > DesiredHeight ? ( m_height - DesiredHeight ) / 2 : 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment