Shaka Packager SDK
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 <cstdint>
11 #include <string>
12 
13 namespace shaka {
14 namespace hls {
15 
18 class Tag {
19  public:
20  Tag(const std::string& name, std::string* buffer);
21 
23  void AddString(const std::string& key, const std::string& value);
24 
26  void AddQuotedString(const std::string& key, const std::string& value);
27 
29  void AddNumber(const std::string& key, uint64_t value);
30 
32  void AddFloat(const std::string& key, float value);
33 
35  void AddNumberPair(const std::string& key,
36  uint64_t number1,
37  char separator,
38  uint64_t number2);
39 
41  void AddQuotedNumberPair(const std::string& key,
42  uint64_t number1,
43  char separator,
44  uint64_t number2);
45 
46  private:
47  Tag(const Tag&) = delete;
48  Tag& operator=(const Tag&) = delete;
49 
50  std::string* const buffer_;
51  size_t fields = 0;
52 
53  void NextField();
54 };
55 
56 } // namespace hls
57 } // namespace shaka
58 
59 #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:25
void AddFloat(const std::string &key, float value)
Add a non-quoted float value to the argument list.
Definition: tag.cc:35
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:49
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:40
void AddNumber(const std::string &key, uint64_t value)
Add a non-quoted numeric value to the argument list.
Definition: tag.cc:30
void AddString(const std::string &key, const std::string &value)
Add a non-quoted string value to the argument list.
Definition: tag.cc:20
All the methods that are virtual are virtual for mocking.
Definition: crypto_flags.cc:66