Coverage Report

Created: 2025-07-11 07:16

/src/vlc/contrib/x86_64-unknown-linux-gnu/include/ebml/EbmlString.h
Line
Count
Source (jump to first uncovered line)
1
/****************************************************************************
2
** libebml : parse EBML files, see http://embl.sourceforge.net/
3
**
4
** <file/class description>
5
**
6
** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
7
**
8
** This file is part of libebml.
9
**
10
** This library is free software; you can redistribute it and/or
11
** modify it under the terms of the GNU Lesser General Public
12
** License as published by the Free Software Foundation; either
13
** version 2.1 of the License, or (at your option) any later version.
14
**
15
** This library is distributed in the hope that it will be useful,
16
** but WITHOUT ANY WARRANTY; without even the implied warranty of
17
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18
** Lesser General Public License for more details.
19
**
20
** You should have received a copy of the GNU Lesser General Public
21
** License along with this library; if not, write to the Free Software
22
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23
**
24
** See http://www.gnu.org/licenses/lgpl-2.1.html for LGPL licensing information.
25
**
26
** Contact license@matroska.org if any conditions of this licensing are
27
** not clear to you.
28
**
29
**********************************************************************/
30
31
/*!
32
  \file
33
  \version \$Id$
34
  \author Steve Lhomme     <robux4 @ users.sf.net>
35
*/
36
#ifndef LIBEBML_STRING_H
37
#define LIBEBML_STRING_H
38
39
#include <string>
40
41
#include "EbmlTypes.h"
42
#include "EbmlElement.h"
43
44
namespace libebml {
45
46
/*!
47
    \class EbmlString
48
    \brief Handle all operations on a printable string EBML element
49
*/
50
class EBML_DLL_API EbmlString : public EbmlElement {
51
  public:
52
    EbmlString();
53
    EbmlString(const std::string & aDefaultValue);
54
18
    EbmlString(const EbmlString & ElementToClone) = default;
55
56
55
    ~EbmlString() override = default;
57
58
80
    bool ValidateSize() const override {return IsFiniteSize() && GetSize() < 0x7FFFFFFF;} // any size is possible
59
    filepos_t RenderData(IOCallback & output, bool bForceRender, bool bWithDefault = false) override;
60
    filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override;
61
    filepos_t UpdateSize(bool bWithDefault = false, bool bForceRender = false) override;
62
63
    EbmlString & operator=(const std::string &);
64
    operator const std::string &() const;
65
66
    EbmlString &SetValue(std::string const &NewValue);
67
    std::string GetValue() const;
68
69
    void SetDefaultValue(std::string &);
70
71
    const std::string & DefaultVal() const;
72
73
0
    bool IsDefaultValue() const override {
74
0
      return (DefaultISset() && Value == DefaultValue);
75
0
    }
76
77
#if defined(EBML_STRICT_API)
78
    private:
79
#else
80
    protected:
81
#endif
82
    std::string Value;  /// The actual value of the element
83
    std::string DefaultValue;
84
};
85
86
} // namespace libebml
87
88
#endif // LIBEBML_STRING_H