mirror of https://github.com/kiwix/libkiwix.git
Introduced src/server/byte_range.cpp
This commit is contained in:
parent
52f207eaa6
commit
f3e79c6b4c
|
@ -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'
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright 2020 Veloman Yunkan <veloman.yunkan@gmail.com>
|
||||
*
|
||||
* 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
|
|
@ -21,6 +21,8 @@
|
|||
#ifndef KIWIXLIB_SERVER_BYTE_RANGE_H
|
||||
#define KIWIXLIB_SERVER_BYTE_RANGE_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
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_; }
|
||||
|
|
Loading…
Reference in New Issue