Shaka Packager SDK
Loading...
Searching...
No Matches
tag.h
1// Copyright 2018 Google LLC. All rights reserved.
2//
3// Use of this source code is governed by a BSD-style
4// license that can be found in the LICENSE file or at
5// https://developers.google.com/open-source/licenses/bsd
6
7#ifndef PACKAGER_HLS_BASE_TAG_H_
8#define PACKAGER_HLS_BASE_TAG_H_
9
10#include <cstddef>
11#include <cstdint>
12#include <string>
13
14namespace shaka {
15namespace hls {
16
19class Tag {
20 public:
21 Tag(const std::string& name, std::string* buffer);
22
24 void AddString(const std::string& key, const std::string& value);
25
27 void AddQuotedString(const std::string& key, const std::string& value);
28
30 void AddNumber(const std::string& key, uint64_t value);
31
33 void AddFloat(const std::string& key, float value);
34
36 void AddNumberPair(const std::string& key,
37 uint64_t number1,
38 char separator,
39 uint64_t number2);
40
42 void AddQuotedNumberPair(const std::string& key,
43 uint64_t number1,
44 char separator,
45 uint64_t number2);
46
47 private:
48 Tag(const Tag&) = delete;
49 Tag& operator=(const Tag&) = delete;
50
51 std::string* const buffer_;
52 size_t fields = 0;
53
54 void NextField();
55};
56
57} // namespace hls
58} // namespace shaka
59
60#endif // PACKAGER_HLS_BASE_TAG_H_
void AddQuotedString(const std::string &key, const std::string &value)
Add a quoted string value to the argument list.
Definition tag.cc:27
void AddFloat(const std::string &key, float value)
Add a non-quoted float value to the argument list.
Definition tag.cc:37
void AddQuotedNumberPair(const std::string &key, uint64_t number1, char separator, uint64_t number2)
Add a quoted pair of numbers with a symbol separating them.
Definition tag.cc:51
void AddNumberPair(const std::string &key, uint64_t number1, char separator, uint64_t number2)
Add a pair of numbers with a symbol separating them.
Definition tag.cc:42
void AddNumber(const std::string &key, uint64_t value)
Add a non-quoted numeric value to the argument list.
Definition tag.cc:32
void AddString(const std::string &key, const std::string &value)
Add a non-quoted string value to the argument list.
Definition tag.cc:22
All the methods that are virtual are virtual for mocking.