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

Side by Side Diff: net/base/pem_tokenizer.h

Issue 6969077: net: Add NET_API to net/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_BASE_PEM_TOKENIZER_H_ 5 #ifndef NET_BASE_PEM_TOKENIZER_H_
6 #define NET_BASE_PEM_TOKENIZER_H_ 6 #define NET_BASE_PEM_TOKENIZER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/string_piece.h" 12 #include "base/string_piece.h"
13 #include "net/base/net_api.h"
13 14
14 namespace net { 15 namespace net {
15 16
16 // PEMTokenizer is a utility class for the parsing of data encapsulated 17 // PEMTokenizer is a utility class for the parsing of data encapsulated
17 // using RFC 1421, Privacy Enhancement for Internet Electronic Mail. It 18 // using RFC 1421, Privacy Enhancement for Internet Electronic Mail. It
18 // does not implement the full specification, most notably it does not 19 // does not implement the full specification, most notably it does not
19 // support the Encapsulated Header Portion described in Section 4.4. 20 // support the Encapsulated Header Portion described in Section 4.4.
20 class PEMTokenizer { 21 class NET_TEST PEMTokenizer {
21 public: 22 public:
22 // Create a new PEMTokenizer that iterates through |str| searching for 23 // Create a new PEMTokenizer that iterates through |str| searching for
23 // instances of PEM encoded blocks that are of the |allowed_block_types|. 24 // instances of PEM encoded blocks that are of the |allowed_block_types|.
24 // |str| must remain valid for the duration of the PEMTokenizer. 25 // |str| must remain valid for the duration of the PEMTokenizer.
25 PEMTokenizer(const base::StringPiece& str, 26 PEMTokenizer(const base::StringPiece& str,
26 const std::vector<std::string>& allowed_block_types); 27 const std::vector<std::string>& allowed_block_types);
27 ~PEMTokenizer(); 28 ~PEMTokenizer();
28 29
29 // Attempts to decode the next PEM block in the string. Returns false if no 30 // Attempts to decode the next PEM block in the string. Returns false if no
30 // PEM blocks can be decoded. The decoded PEM block will be available via 31 // PEM blocks can be decoded. The decoded PEM block will be available via
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 69
69 // The raw (Base64-decoded) data of the last successfully decoded block. 70 // The raw (Base64-decoded) data of the last successfully decoded block.
70 std::string data_; 71 std::string data_;
71 72
72 DISALLOW_COPY_AND_ASSIGN(PEMTokenizer); 73 DISALLOW_COPY_AND_ASSIGN(PEMTokenizer);
73 }; 74 };
74 75
75 } // namespace net 76 } // namespace net
76 77
77 #endif // NET_BASE_PEM_TOKENIZER_H_ 78 #endif // NET_BASE_PEM_TOKENIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698