mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-31 16:20:22 +00:00
25 lines
522 B
C++
25 lines
522 B
C++
// ASE base library
|
|
// Copyright (C) 2001-2011 David Capello
|
|
//
|
|
// This source file is ditributed under a BSD-like license, please
|
|
// read LICENSE.txt for more information.
|
|
|
|
#include "config.h"
|
|
|
|
#include <cstdlib>
|
|
#include <cstdio>
|
|
|
|
#include "base/convert_to.h"
|
|
|
|
template<> int base::convert_to(const base::string& from)
|
|
{
|
|
return std::strtol(from.c_str(), NULL, 10);
|
|
}
|
|
|
|
template<> base::string base::convert_to(const int& from)
|
|
{
|
|
char buf[32];
|
|
std::sprintf(buf, "%d", from);
|
|
return buf;
|
|
}
|