Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: third_party/libjingle_xmpp/xmllite/xmlnsstack.h

Issue 2443903004: Add xmllite and xmpp sources to third_party/ (Closed)
Patch Set: Explicitly use webrtc_overrides/webrtc/base/logging.h Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_LIBJINGLE_XMLLITE_XMLNSSTACK_H_
12 #define WEBRTC_LIBJINGLE_XMLLITE_XMLNSSTACK_H_
13
14 #include <memory>
15 #include <string>
16 #include <vector>
17 #include "third_party/libjingle_xmpp/xmllite/qname.h"
18
19 namespace buzz {
20
21 class XmlnsStack {
22 public:
23 XmlnsStack();
24 ~XmlnsStack();
25
26 void AddXmlns(const std::string& prefix, const std::string& ns);
27 void RemoveXmlns();
28 void PushFrame();
29 void PopFrame();
30 void Reset();
31
32 std::pair<std::string, bool> NsForPrefix(const std::string& prefix);
33 bool PrefixMatchesNs(const std::string & prefix, const std::string & ns);
34 std::pair<std::string, bool> PrefixForNs(const std::string& ns, bool isAttr);
35 std::pair<std::string, bool> AddNewPrefix(const std::string& ns, bool isAttr);
36 std::string FormatQName(const QName & name, bool isAttr);
37
38 private:
39
40 std::unique_ptr<std::vector<std::string> > pxmlnsStack_;
41 std::unique_ptr<std::vector<size_t> > pxmlnsDepthStack_;
42 };
43 }
44
45 #endif // WEBRTC_LIBJINGLE_XMLLITE_XMLNSSTACK_H_
OLDNEW
« no previous file with comments | « third_party/libjingle_xmpp/xmllite/xmlelement_unittest.cc ('k') | third_party/libjingle_xmpp/xmllite/xmlnsstack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698