blob: ab15e97bbc1c288e9bccb886689eae4bd6893550 [file] [log] [blame]
Fletcher Woodruffdd635822020-04-23 12:49:39 -06001// Copyright 2020 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef __XML_UTIL_H__
6#define __XML_UTIL_H__
7
8#include <stdint.h>
9
10#include <vector>
11
Fletcher Woodruffa6d238f2020-05-18 16:25:43 -060012#include <base/optional.h>
13
Fletcher Woodruffdd635822020-04-23 12:49:39 -060014#include "escl_manager.h"
15
16// Returns a serialized eSCL ScannerCapabilities XML representation of |caps|.
17// For fields that are not provided by |caps|, sensible default values are
18// chosen.
19std::vector<uint8_t> ScannerCapabilitiesAsXml(const ScannerCapabilities& caps);
20
Fletcher Woodruff70ccf552020-04-17 14:08:06 -060021// Returns a serialized eSCL ScannerStatus XML representation of |status|.
22std::vector<uint8_t> ScannerStatusAsXml(const ScannerStatus& status);
23
Fletcher Woodruffa6d238f2020-05-18 16:25:43 -060024// Attempts to parse a ScanSettings object from its xml representation, |xml|.
25base::Optional<ScanSettings> ScanSettingsFromXml(
26 const std::vector<uint8_t>& xml);
27
Fletcher Woodruffdd635822020-04-23 12:49:39 -060028#endif // __XML_UTIL_H__