diff --git a/src/meson.build b/src/meson.build index 411f14f2..ddb18811 100644 --- a/src/meson.build +++ b/src/meson.build @@ -21,6 +21,7 @@ kiwix_sources = [ 'tools/otherTools.cpp', 'kiwixserve.cpp', 'name_mapper.cpp', + 'server/byte_range.cpp', 'server/etag.cpp', 'server/request_context.cpp', 'server/response.cpp' diff --git a/src/server/byte_range.cpp b/src/server/byte_range.cpp new file mode 100644 index 00000000..5b3c98b2 --- /dev/null +++ b/src/server/byte_range.cpp @@ -0,0 +1,37 @@ +/* + * Copyright 2020 Veloman Yunkan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + + +#include "byte_range.h" + +namespace kiwix { + +ByteRange::ByteRange() + : kind_(NONE) + , first_(0) + , last_(-1) +{} + +ByteRange::ByteRange(Kind kind, int64_t first, int64_t last) + : kind_(kind) + , first_(first) + , last_(last) +{} + +} // namespace kiwix diff --git a/src/server/byte_range.h b/src/server/byte_range.h index b9719d8b..4df6bd93 100644 --- a/src/server/byte_range.h +++ b/src/server/byte_range.h @@ -21,6 +21,8 @@ #ifndef KIWIXLIB_SERVER_BYTE_RANGE_H #define KIWIXLIB_SERVER_BYTE_RANGE_H +#include + namespace kiwix { class ByteRange @@ -41,13 +43,8 @@ class ByteRange }; public: // functions - ByteRange() : kind_(NONE), first_(0), last_(-1) {} - - ByteRange(Kind kind, int64_t first, int64_t last) - : kind_(kind) - , first_(first) - , last_(last) - {} + ByteRange(); + ByteRange(Kind kind, int64_t first, int64_t last); Kind kind() const { return kind_; } int64_t first() const { return first_; }