Fletcher Woodruff | dd63582 | 2020-04-23 12:49:39 -0600 | [diff] [blame] | 1 | // 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 Woodruff | a6d238f | 2020-05-18 16:25:43 -0600 | [diff] [blame] | 12 | #include <base/optional.h> |
| 13 | |
Fletcher Woodruff | dd63582 | 2020-04-23 12:49:39 -0600 | [diff] [blame] | 14 | #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. |
| 19 | std::vector<uint8_t> ScannerCapabilitiesAsXml(const ScannerCapabilities& caps); |
| 20 | |
Fletcher Woodruff | 70ccf55 | 2020-04-17 14:08:06 -0600 | [diff] [blame] | 21 | // Returns a serialized eSCL ScannerStatus XML representation of |status|. |
| 22 | std::vector<uint8_t> ScannerStatusAsXml(const ScannerStatus& status); |
| 23 | |
Fletcher Woodruff | a6d238f | 2020-05-18 16:25:43 -0600 | [diff] [blame] | 24 | // Attempts to parse a ScanSettings object from its xml representation, |xml|. |
| 25 | base::Optional<ScanSettings> ScanSettingsFromXml( |
| 26 | const std::vector<uint8_t>& xml); |
| 27 | |
Fletcher Woodruff | dd63582 | 2020-04-23 12:49:39 -0600 | [diff] [blame] | 28 | #endif // __XML_UTIL_H__ |