Kea 2.7.1
char_string.h
Go to the documentation of this file.
1// Copyright (C) 2012-2024 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef DNS_RDATA_CHARSTRING_H
8#define DNS_RDATA_CHARSTRING_H
9
10#include <dns/master_lexer.h>
11
12#include <string>
13#include <vector>
14#include <algorithm>
15#include <stdint.h>
16
17namespace isc {
18namespace dns {
19namespace rdata {
20namespace generic {
21namespace detail {
22
27typedef std::vector<uint8_t> CharString;
28
30typedef std::vector<uint8_t> CharStringData;
31
49 CharString& result);
50
63 CharStringData& result);
64
77std::string charStringToString(const CharString& char_string);
78
86std::string charStringDataToString(const CharStringData& char_string);
87
96int compareCharStrings(const CharString& self, const CharString& other);
97
107 const CharStringData& other);
108
127size_t bufferToCharString(isc::util::InputBuffer& buffer, size_t rdata_len,
128 CharString& target);
129
130
131} // namespace detail
132} // namespace generic
133} // namespace rdata
134} // namespace dns
135} // namespace isc
136#endif // DNS_RDATA_CHARSTRING_H
The InputBuffer class is a buffer abstraction for manipulating read-only data.
Definition buffer.h:81
std::string charStringToString(const CharString &char_string)
Convert a CharString into a textual DNS character-string.
int compareCharStrings(const detail::CharString &self, const detail::CharString &other)
Compare two CharString objects.
int compareCharStringDatas(const detail::CharStringData &self, const detail::CharStringData &other)
Compare two CharStringData objects.
void stringToCharString(const MasterToken::StringRegion &str_region, CharString &result)
Convert a DNS character-string into corresponding binary data.
std::vector< uint8_t > CharStringData
Type for DNS character string without the length prefix.
Definition char_string.h:30
void stringToCharStringData(const MasterToken::StringRegion &str_region, CharStringData &result)
Convert a DNS character-string into corresponding binary data.
size_t bufferToCharString(isc::util::InputBuffer &buffer, size_t rdata_len, CharString &target)
Convert a buffer containing a character-string to CharString.
std::string charStringDataToString(const CharStringData &char_string)
Convert a CharStringData into a textual DNS character-string.
std::vector< uint8_t > CharString
Type for DNS character string.
Definition char_string.h:27
Defines the logger used by the top-level component of kea-lfc.
A simple representation of a range of a string.