aseprite/src/base/convert_to.cpp
2011-01-18 20:49:53 -03:00

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;
}