mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-04-02 10:42:14 -04:00
This represents a major code restructuring. The dot-based and scanline-based renderers are now split into two separate core libraries, asnes and bsnes. For now at least, these are -internal- names. I'm not entirely decided on how I'm going to handle releasing these two separate builds. Regardless, the folders need names. asnes has had all of the processor subfolders collapsed back into their parent folders. In other words, ppu's functions were moved into ppu/sppu, and then ppu was deleted, and then ppu/sppu became the new ppu. Repeat this for the cpu, smp and dsp and there you go. asnes/dsp also removed the DSP_STATE_MACHINE option. This was done for the sake of consistency with the rest of the core. asnes' debugger mode is currently extremely broken, but I will be fixing it in time. And for now, bsnes has kept the processor abstraction layer. I may keep it around, not sure yet. It doesn't hurt speed or anything, so I'm not too worried about making a decision right away. I may throw snesfilter, snesreader and supergameboy into this folder, just to have everything in one place. The alternate GUI forks are definitely going in there as dotnet, cocoa and python. Compiled output goes to the out/ folder now, to prevent conflicts with a file and folder named bsnes, for instance.
32 lines
1.5 KiB
C++
32 lines
1.5 KiB
C++
#ifndef NALL_STRING_CAST_HPP
|
|
#define NALL_STRING_CAST_HPP
|
|
|
|
namespace nall {
|
|
|
|
//this is needed, as C++0x does not support explicit template specialization inside classes
|
|
template<> inline string to_string<bool> (bool v) { return v ? "true" : "false"; }
|
|
template<> inline string to_string<signed int> (signed int v) { return strsigned(v); }
|
|
template<> inline string to_string<unsigned int> (unsigned int v) { return strunsigned(v); }
|
|
template<> inline string to_string<double> (double v) { return strdouble(v); }
|
|
template<> inline string to_string<char*> (char *v) { return v; }
|
|
template<> inline string to_string<const char*> (const char *v) { return v; }
|
|
template<> inline string to_string<string> (string v) { return v; }
|
|
template<> inline string to_string<const string&>(const string &v) { return v; }
|
|
|
|
template<typename T> string& string::operator= (T value) { return assign(to_string<T>(value)); }
|
|
template<typename T> string& string::operator<<(T value) { return append(to_string<T>(value)); }
|
|
|
|
template<typename T> lstring& lstring::operator<<(T value) {
|
|
operator[](size()).assign(to_string<T>(value));
|
|
return *this;
|
|
}
|
|
|
|
#if defined(QSTRING_H)
|
|
template<> inline string to_string<QString>(QString v) { return v.toUtf8().constData(); }
|
|
template<> inline string to_string<const QString&>(const QString &v) { return v.toUtf8().constData(); }
|
|
string::operator QString() const { return QString::fromUtf8(*this); }
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif
|