Remove Nz::String and Nz::StringStream
This commit is contained in:
@@ -71,7 +71,7 @@ namespace Nz
|
||||
return static_cast<AudioFormat>(channelCount);
|
||||
|
||||
default:
|
||||
NazaraError("Invalid channel count: " + String::Number(channelCount));
|
||||
NazaraError("Invalid channel count: " + NumberToString(channelCount));
|
||||
return AudioFormat_Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace Nz
|
||||
m_handle = sf_open_virtual(&callbacks, SFM_READ, &infos, &stream);
|
||||
if (!m_handle)
|
||||
{
|
||||
NazaraError("Failed to open sound: " + String(sf_strerror(m_handle)));
|
||||
NazaraError("Failed to open sound: " + std::string(sf_strerror(m_handle)));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ namespace Nz
|
||||
SNDFILE* file = sf_open_virtual(&callbacks, SFM_READ, &info, &stream);
|
||||
if (!file)
|
||||
{
|
||||
NazaraError("Failed to load sound file: " + String(sf_strerror(file)));
|
||||
NazaraError("Failed to load sound file: " + std::string(sf_strerror(file)));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <Nazara/Core/DynLib.hpp>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <Nazara/Core/Log.hpp>
|
||||
#include <Nazara/Core/StringExt.hpp>
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
@@ -16,9 +17,9 @@ namespace Nz
|
||||
namespace
|
||||
{
|
||||
DynLib s_library;
|
||||
String s_deviceName;
|
||||
String s_rendererName;
|
||||
String s_vendorName;
|
||||
std::string s_deviceName;
|
||||
std::string s_rendererName;
|
||||
std::string s_vendorName;
|
||||
ALCdevice* s_device = nullptr;
|
||||
ALCcontext* s_context = nullptr;
|
||||
unsigned int s_version;
|
||||
@@ -31,7 +32,7 @@ namespace Nz
|
||||
* \param devices List of names of the devices
|
||||
*/
|
||||
|
||||
std::size_t ParseDevices(const char* deviceString, std::vector<String>& devices)
|
||||
std::size_t ParseDevices(const char* deviceString, std::vector<std::string>& devices)
|
||||
{
|
||||
if (!deviceString)
|
||||
return 0;
|
||||
@@ -66,9 +67,9 @@ namespace Nz
|
||||
* \remark This does not produces a NazaraError if entry does not exist
|
||||
*/
|
||||
|
||||
OpenALFunc OpenAL::GetEntry(const String& entryPoint)
|
||||
OpenALFunc OpenAL::GetEntry(const std::string& entryPoint)
|
||||
{
|
||||
return LoadEntry(entryPoint.GetConstBuffer(), false);
|
||||
return LoadEntry(entryPoint.data(), false);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -76,7 +77,7 @@ namespace Nz
|
||||
* \return Name of the renderer
|
||||
*/
|
||||
|
||||
String OpenAL::GetRendererName()
|
||||
std::string OpenAL::GetRendererName()
|
||||
{
|
||||
return s_rendererName;
|
||||
}
|
||||
@@ -86,7 +87,7 @@ namespace Nz
|
||||
* \return Name of the vendor
|
||||
*/
|
||||
|
||||
String OpenAL::GetVendorName()
|
||||
std::string OpenAL::GetVendorName()
|
||||
{
|
||||
return s_vendorName;
|
||||
}
|
||||
@@ -284,7 +285,7 @@ namespace Nz
|
||||
* \param devices List of names of the input devices
|
||||
*/
|
||||
|
||||
std::size_t OpenAL::QueryInputDevices(std::vector<String>& devices)
|
||||
std::size_t OpenAL::QueryInputDevices(std::vector<std::string>& devices)
|
||||
{
|
||||
const char* deviceString = reinterpret_cast<const char*>(alcGetString(nullptr, ALC_CAPTURE_DEVICE_SPECIFIER));
|
||||
if (!deviceString)
|
||||
@@ -300,7 +301,7 @@ namespace Nz
|
||||
* \param devices List of names of the output devices
|
||||
*/
|
||||
|
||||
std::size_t OpenAL::QueryOutputDevices(std::vector<String>& devices)
|
||||
std::size_t OpenAL::QueryOutputDevices(std::vector<std::string>& devices)
|
||||
{
|
||||
const char* deviceString = reinterpret_cast<const char*>(alcGetString(nullptr, ALC_ALL_DEVICES_SPECIFIER));
|
||||
if (!deviceString)
|
||||
@@ -316,7 +317,7 @@ namespace Nz
|
||||
* \param deviceName Name of the device
|
||||
*/
|
||||
|
||||
bool OpenAL::SetDevice(const String& deviceName)
|
||||
bool OpenAL::SetDevice(const std::string& deviceName)
|
||||
{
|
||||
s_deviceName = deviceName;
|
||||
if (IsInitialized())
|
||||
@@ -337,8 +338,8 @@ namespace Nz
|
||||
{
|
||||
CloseDevice();
|
||||
|
||||
s_rendererName.Clear(false);
|
||||
s_vendorName.Clear(false);
|
||||
s_rendererName.clear();
|
||||
s_vendorName.clear();
|
||||
s_library.Unload();
|
||||
}
|
||||
|
||||
@@ -380,7 +381,7 @@ namespace Nz
|
||||
bool OpenAL::OpenDevice()
|
||||
{
|
||||
// Initialisation of the module
|
||||
s_device = alcOpenDevice(s_deviceName.IsEmpty() ? nullptr : s_deviceName.GetConstBuffer()); // We choose the default device
|
||||
s_device = alcOpenDevice(s_deviceName.empty() ? nullptr : s_deviceName.data()); // We choose the default device
|
||||
if (!s_device)
|
||||
{
|
||||
NazaraError("Failed to open default device");
|
||||
@@ -420,7 +421,7 @@ namespace Nz
|
||||
|
||||
s_version = major*100 + minor*10;
|
||||
|
||||
NazaraDebug("OpenAL version: " + String::Number(major) + '.' + String::Number(minor));
|
||||
NazaraDebug("OpenAL version: " + NumberToString(major) + '.' + NumberToString(minor));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace Nz
|
||||
SoundBufferRef buffer = SoundBuffer::LoadFromMemory(data, size, params);
|
||||
if (!buffer)
|
||||
{
|
||||
NazaraError("Failed to load buffer from memory (" + String::Pointer(data) + ')');
|
||||
NazaraError("Failed to load buffer from memory (" + PointerToString(data) + ')');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user