Get foreground tab on Android
[chromium-blink-merge.git] / chrome / utility / media_galleries / iapps_xml_utils.h
blobdae375108dda70dfe30414f3fab8c8bafc37af4e
1 // Copyright 2013 The Chromium 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.
5 #ifndef CHROME_UTILITY_MEDIA_GALLERIES_IAPPS_XML_UTILS_H_
6 #define CHROME_UTILITY_MEDIA_GALLERIES_IAPPS_XML_UTILS_H_
8 #include <string>
10 #include "base/platform_file.h"
12 class XmlReader;
14 namespace iapps {
16 // Like XmlReader::SkipToElement, but will advance to the next open tag if the
17 // cursor is on a close tag.
18 bool SkipToNextElement(XmlReader* reader);
20 // Traverse |reader| looking for a node named |name| at the current depth
21 // of |reader|.
22 bool SeekToNodeAtCurrentDepth(XmlReader* reader, const std::string& name);
24 // Search within a "dict" node for |key|. The cursor must be on the starting
25 // "dict" node when entering this function.
26 bool SeekInDict(XmlReader* reader, const std::string& key);
28 // Get the value out of a string node.
29 bool ReadString(XmlReader* reader, std::string* result);
31 // Get the value out of an integer node.
32 bool ReadInteger(XmlReader* reader, uint64* result);
34 // Read in the contents of the given library xml |file| and return as a string.
35 std::string ReadPlatformFileAsString(const base::PlatformFile file);
37 } // namespace iapps
39 #endif // CHROME_UTILITY_MEDIA_GALLERIES_IAPPS_XML_UTILS_H_