Normalized line ending

Former-commit-id: bd061c48bdc8f0d26159dac3b41017defef5ae1e
This commit is contained in:
Lynix
2012-09-21 14:24:48 +02:00
parent 4b3772e2d8
commit a73cd1374a
72 changed files with 25415 additions and 25415 deletions

View File

@@ -1,49 +1,49 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/InputStream.hpp>
#include <Nazara/Core/String.hpp>
#include <Nazara/Core/Debug.hpp>
NzInputStream::~NzInputStream() = default;
NzString NzInputStream::GetLine(unsigned int lineSize)
{
NzString line;
if (lineSize == 0) // Taille maximale indéterminée
{
while (!EndOfStream())
{
char c;
if (Read(&c, sizeof(char)) == sizeof(char))
{
if (c == '\n')
break;
line += c;
}
else
break;
}
}
else
{
line.Reserve(lineSize);
for (unsigned int i = 0; i < lineSize; ++i)
{
char c;
if (Read(&c, sizeof(char)) == sizeof(char))
{
if (c == '\n')
break;
line += c;
}
else
break;
}
}
return line;
}
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/InputStream.hpp>
#include <Nazara/Core/String.hpp>
#include <Nazara/Core/Debug.hpp>
NzInputStream::~NzInputStream() = default;
NzString NzInputStream::GetLine(unsigned int lineSize)
{
NzString line;
if (lineSize == 0) // Taille maximale indéterminée
{
while (!EndOfStream())
{
char c;
if (Read(&c, sizeof(char)) == sizeof(char))
{
if (c == '\n')
break;
line += c;
}
else
break;
}
}
else
{
line.Reserve(lineSize);
for (unsigned int i = 0; i < lineSize; ++i)
{
char c;
if (Read(&c, sizeof(char)) == sizeof(char))
{
if (c == '\n')
break;
line += c;
}
else
break;
}
}
return line;
}