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

Side by Side Diff: webrtc/libjingle/xmllite/xmlnsstack.h

Issue 1965063003: Revert of Remove webrtc/base/scoped_ptr.h (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « webrtc/libjingle/xmllite/xmlelement.h ('k') | webrtc/libjingle/xmpp/fakexmppclient.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_LIBJINGLE_XMLLITE_XMLNSSTACK_H_ 11 #ifndef WEBRTC_LIBJINGLE_XMLLITE_XMLNSSTACK_H_
12 #define WEBRTC_LIBJINGLE_XMLLITE_XMLNSSTACK_H_ 12 #define WEBRTC_LIBJINGLE_XMLLITE_XMLNSSTACK_H_
13 13
14 #include <memory> 14 #include <memory>
15 #include <string> 15 #include <string>
16 #include <vector> 16 #include <vector>
17 #include "webrtc/libjingle/xmllite/qname.h" 17 #include "webrtc/libjingle/xmllite/qname.h"
18 #include "webrtc/base/scoped_ptr.h"
18 19
19 namespace buzz { 20 namespace buzz {
20 21
21 class XmlnsStack { 22 class XmlnsStack {
22 public: 23 public:
23 XmlnsStack(); 24 XmlnsStack();
24 ~XmlnsStack(); 25 ~XmlnsStack();
25 26
26 void AddXmlns(const std::string& prefix, const std::string& ns); 27 void AddXmlns(const std::string& prefix, const std::string& ns);
27 void RemoveXmlns(); 28 void RemoveXmlns();
28 void PushFrame(); 29 void PushFrame();
29 void PopFrame(); 30 void PopFrame();
30 void Reset(); 31 void Reset();
31 32
32 std::pair<std::string, bool> NsForPrefix(const std::string& prefix); 33 std::pair<std::string, bool> NsForPrefix(const std::string& prefix);
33 bool PrefixMatchesNs(const std::string & prefix, const std::string & ns); 34 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> PrefixForNs(const std::string& ns, bool isAttr);
35 std::pair<std::string, bool> AddNewPrefix(const std::string& ns, bool isAttr); 36 std::pair<std::string, bool> AddNewPrefix(const std::string& ns, bool isAttr);
36 std::string FormatQName(const QName & name, bool isAttr); 37 std::string FormatQName(const QName & name, bool isAttr);
37 38
38 private: 39 private:
39 40
40 std::unique_ptr<std::vector<std::string> > pxmlnsStack_; 41 std::unique_ptr<std::vector<std::string> > pxmlnsStack_;
41 std::unique_ptr<std::vector<size_t> > pxmlnsDepthStack_; 42 std::unique_ptr<std::vector<size_t> > pxmlnsDepthStack_;
42 }; 43 };
43 } 44 }
44 45
45 #endif // WEBRTC_LIBJINGLE_XMLLITE_XMLNSSTACK_H_ 46 #endif // WEBRTC_LIBJINGLE_XMLLITE_XMLNSSTACK_H_
OLDNEW
« no previous file with comments | « webrtc/libjingle/xmllite/xmlelement.h ('k') | webrtc/libjingle/xmpp/fakexmppclient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698