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

          Line data    Source code
       1             : /**
       2             : * @file      BString.h
       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     Representation of a string.
       6             : */
       7             : 
       8             : #ifndef BENCODING_BSTRING_H
       9             : #define BENCODING_BSTRING_H
      10             : 
      11             : #include <memory>
      12             : #include <string>
      13             : 
      14             : #include "BItem.h"
      15             : 
      16             : namespace bencoding {
      17             : 
      18             : /**
      19             : * @brief Representation of a string.
      20             : *
      21             : * Use create() to create instances of the class.
      22             : */
      23          78 : class BString: public BItem {
      24             : public:
      25             :     /// Type of the underlying string value.
      26             :     using ValueType = std::string;
      27             : 
      28             : public:
      29             :     static std::unique_ptr<BString> create(ValueType value);
      30             : 
      31             :     ValueType value() const;
      32             :     void setValue(ValueType value);
      33             :     ValueType::size_type length() const;
      34             : 
      35             :     /// @name BItemVisitor Support
      36             :     /// @{
      37             :     virtual void accept(BItemVisitor *visitor) override;
      38             :     /// @}
      39             : 
      40             : private:
      41             :     explicit BString(ValueType value);
      42             : 
      43             : private:
      44             :     ValueType _value;
      45             : };
      46             : 
      47             : } // namespace bencoding
      48             : 
      49             : #endif

Generated by: LCOV version 1.13