| OLD | NEW |
| 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
| 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 4 * | 4 * |
| 5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
| 6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
| 7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
| 8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
| 9 * | 9 * |
| 10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #ifndef CHROME_BROWSER_IMPORTER_MORK_READER_H_ | 42 #ifndef CHROME_BROWSER_IMPORTER_MORK_READER_H_ |
| 43 #define CHROME_BROWSER_IMPORTER_MORK_READER_H_ | 43 #define CHROME_BROWSER_IMPORTER_MORK_READER_H_ |
| 44 | 44 |
| 45 #include <fstream> | 45 #include <fstream> |
| 46 #include <map> | 46 #include <map> |
| 47 #include <string> | 47 #include <string> |
| 48 #include <vector> | 48 #include <vector> |
| 49 | 49 |
| 50 #include "base/basictypes.h" | 50 #include "base/basictypes.h" |
| 51 | 51 |
| 52 class ImporterBridge; |
| 53 |
| 54 namespace base { |
| 52 class FilePath; | 55 class FilePath; |
| 53 class ImporterBridge; | 56 } |
| 54 | 57 |
| 55 // The nsMorkReader object allows a consumer to read in a mork-format | 58 // The nsMorkReader object allows a consumer to read in a mork-format |
| 56 // file and enumerate the rows that it contains. It does not provide | 59 // file and enumerate the rows that it contains. It does not provide |
| 57 // any functionality for modifying mork tables. | 60 // any functionality for modifying mork tables. |
| 58 // | 61 // |
| 59 // References: | 62 // References: |
| 60 // http://www.mozilla.org/mailnews/arch/mork/primer.txt | 63 // http://www.mozilla.org/mailnews/arch/mork/primer.txt |
| 61 // http://www.mozilla.org/mailnews/arch/mork/grammar.txt | 64 // http://www.mozilla.org/mailnews/arch/mork/grammar.txt |
| 62 // http://www.jwz.org/hacks/mork.pl | 65 // http://www.jwz.org/hacks/mork.pl |
| 63 class MorkReader { | 66 class MorkReader { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 83 // to an array for each column. | 86 // to an array for each column. |
| 84 typedef std::map<IDString, ColumnDataList*> RowMap; | 87 typedef std::map<IDString, ColumnDataList*> RowMap; |
| 85 | 88 |
| 86 typedef RowMap::const_iterator iterator; | 89 typedef RowMap::const_iterator iterator; |
| 87 | 90 |
| 88 MorkReader(); | 91 MorkReader(); |
| 89 ~MorkReader(); | 92 ~MorkReader(); |
| 90 | 93 |
| 91 // Read in the given mork file. Returns true on success. | 94 // Read in the given mork file. Returns true on success. |
| 92 // Note: currently, only single-table mork files are supported | 95 // Note: currently, only single-table mork files are supported |
| 93 bool Read(const FilePath& filename); | 96 bool Read(const base::FilePath& filename); |
| 94 | 97 |
| 95 // Returns the list of columns in the current table. | 98 // Returns the list of columns in the current table. |
| 96 const MorkColumnList& columns() const { return columns_; } | 99 const MorkColumnList& columns() const { return columns_; } |
| 97 | 100 |
| 98 // Get the "meta row" for the table. Each table has at most one meta row, | 101 // Get the "meta row" for the table. Each table has at most one meta row, |
| 99 // which records information about the table. Like normal rows, the | 102 // which records information about the table. Like normal rows, the |
| 100 // meta row contains columns in the same order as returned by columns(). | 103 // meta row contains columns in the same order as returned by columns(). |
| 101 // Returns null if there is no meta row for this table. | 104 // Returns null if there is no meta row for this table. |
| 102 const ColumnDataList& meta_row() const { return meta_row_; } | 105 const ColumnDataList& meta_row() const { return meta_row_; } |
| 103 | 106 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 154 |
| 152 // The data of the columns in the meta row. | 155 // The data of the columns in the meta row. |
| 153 ColumnDataList meta_row_; | 156 ColumnDataList meta_row_; |
| 154 | 157 |
| 155 // The contents of the mork database. This array pointer is owned by this | 158 // The contents of the mork database. This array pointer is owned by this |
| 156 // class and must be deleted. | 159 // class and must be deleted. |
| 157 RowMap table_; | 160 RowMap table_; |
| 158 }; | 161 }; |
| 159 | 162 |
| 160 // ImportHistoryFromFirefox2 is the main entry point to the importer. | 163 // ImportHistoryFromFirefox2 is the main entry point to the importer. |
| 161 void ImportHistoryFromFirefox2(const FilePath& file, ImporterBridge* bridge); | 164 void ImportHistoryFromFirefox2(const base::FilePath& file, ImporterBridge* bridg
e); |
| 162 | 165 |
| 163 #endif // CHROME_BROWSER_IMPORTER_MORK_READER_H_ | 166 #endif // CHROME_BROWSER_IMPORTER_MORK_READER_H_ |
| OLD | NEW |