Remove Nz::String and Nz::StringStream

This commit is contained in:
Jérôme Leclercq
2020-09-25 19:31:01 +02:00
parent d665af1f9d
commit 2b6a463a45
212 changed files with 1877 additions and 8721 deletions

View File

@@ -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
{