• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

arangodb / velocypack / 3998645281

pending completion
3998645281

Pull #148

github

GitHub
Merge b1e3c924b into 5a28b6413
Pull Request #148: use separate namespace for xxh functions

0 of 5107 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/velocypack-common.cpp
1
////////////////////////////////////////////////////////////////////////////////
2
/// DISCLAIMER
3
///
4
/// Copyright 2014-2020 ArangoDB GmbH, Cologne, Germany
5
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
6
///
7
/// Licensed under the Apache License, Version 2.0 (the "License");
8
/// you may not use this file except in compliance with the License.
9
/// You may obtain a copy of the License at
10
///
11
///     http://www.apache.org/licenses/LICENSE-2.0
12
///
13
/// Unless required by applicable law or agreed to in writing, software
14
/// distributed under the License is distributed on an "AS IS" BASIS,
15
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
/// See the License for the specific language governing permissions and
17
/// limitations under the License.
18
///
19
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
20
///
21
/// @author Max Neunhoeffer
22
/// @author Jan Steemann
23
////////////////////////////////////////////////////////////////////////////////
24

25
#include <chrono>
26

27
#include "velocypack/velocypack-common.h"
28
#include "velocypack/Exception.h"
29

30
using namespace arangodb::velocypack;
31

32
#ifndef VELOCYPACK_64BIT
33
// check if the length is beyond the size of a SIZE_MAX on this platform
34
std::size_t arangodb::velocypack::checkOverflow(ValueLength length) {
35
  if (length > static_cast<ValueLength>(SIZE_MAX)) {
36
    throw Exception(Exception::NumberOutOfRange);
37
  }
38
  return static_cast<std::size_t>(length);
39
}
40
#else
41
// 64 bit platform
42
static_assert(sizeof(std::size_t) == 8, "unexpected size_t size");
43
static_assert(sizeof(std::size_t) == sizeof(uint64_t),
44
              "unexpected size_t size");
45
#endif
46

47
int64_t arangodb::velocypack::currentUTCDateValue() {
×
48
  return static_cast<int64_t>(
49
      std::chrono::duration_cast<std::chrono::milliseconds>(
×
50
          std::chrono::system_clock::now().time_since_epoch())
×
51
          .count());
×
52
}
53

54
static_assert(sizeof(arangodb::velocypack::ValueLength) >= sizeof(SIZE_MAX),
55
              "invalid value for SIZE_MAX");
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc