LCOV - code coverage report
Current view: top level - src - BInteger.cpp (source / functions) Hit Total Coverage
Test: cpp-bencoding code coverage Lines: 11 11 100.0 %
Date: 2018-04-21 15:28:44 Functions: 5 5 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /**
       2             : * @file      BInteger.cpp
       3             : * @copyright (c) 2014 by Petr Zemek (s3rvac@gmail.com) and contributors
       4             : * @license   BSD, see the @c LICENSE file for more details
       5             : * @brief     Implementation of the BInteger class.
       6             : */
       7             : 
       8             : #include "BInteger.h"
       9             : 
      10             : #include "BItemVisitor.h"
      11             : 
      12             : namespace bencoding {
      13             : 
      14             : /**
      15             : * @brief Constructs the integer with the given @a value.
      16             : */
      17          63 : BInteger::BInteger(ValueType value): _value(value) {}
      18             : 
      19             : /**
      20             : * @brief Creates and returns a new integer.
      21             : */
      22          63 : std::unique_ptr<BInteger> BInteger::create(ValueType value) {
      23          63 :     return std::unique_ptr<BInteger>(new BInteger(value));
      24             : }
      25             : 
      26             : /**
      27             : * @brief Returns the integer's value.
      28             : */
      29          35 : auto BInteger::value() const -> ValueType {
      30          35 :     return _value;
      31             : }
      32             : 
      33             : /**
      34             : * @brief Sets a new value.
      35             : */
      36           1 : void BInteger::setValue(ValueType value) {
      37           1 :     _value = value;
      38           1 : }
      39             : 
      40          14 : void BInteger::accept(BItemVisitor *visitor) {
      41          14 :     visitor->visit(this);
      42          14 : }
      43             : 
      44             : } // namespace bencoding

Generated by: LCOV version 1.13