moved rtrim() to rtrim.hpp, removed duplicate startsWith()

Dieser Commit ist enthalten in:
Reinder Feenstra 2021-12-03 23:36:22 +01:00
Ursprung 163d2c95e2
Commit a230e96506
3 geänderte Dateien mit 6 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -25,7 +25,7 @@
#include "../../decoder/decoder.hpp"
#include "../../decoder/decoderchangeflags.hpp"
#include "../../../utils/setthreadname.hpp"
#include "../../../utils/string.hpp"
#include "../../../utils/rtrim.hpp"
#include "../../../core/eventloop.hpp"
#include "../../../log/log.hpp"

Datei anzeigen

@ -1,9 +1,9 @@
/**
* server/src/utils/string.hpp
* server/src/utils/rtrim.hpp
*
* This file is part of the traintastic source code.
*
* Copyright (C) 2019-2020 Reinder Feenstra
* Copyright (C) 2021 Reinder Feenstra
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -20,16 +20,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef TRAINTASTIC_SERVER_UTILS_STRING_HPP
#define TRAINTASTIC_SERVER_UTILS_STRING_HPP
#ifndef TRAINTASTIC_SERVER_UTILS_RTRIM_HPP
#define TRAINTASTIC_SERVER_UTILS_RTRIM_HPP
#include <string_view>
constexpr bool startsWith(std::string_view s, std::string_view prefix)
{
return s.rfind(prefix, 0) == 0;
}
constexpr std::string_view rtrim(std::string_view s, char c)
{
if(s.empty())

Datei anzeigen

@ -26,7 +26,7 @@
#include <boost/uuid/string_generator.hpp>
#include <boost/uuid/uuid_io.hpp>
#include "world.hpp"
#include "../utils/string.hpp"
#include "../utils/startswith.hpp"
#include "ctwreader.hpp"
#include "../board/board.hpp"