libphonenumber-csharp / cpp / src / phonenumbers / geocoding / default_map_storage.h

Diff from to


-#include <map>
-#include <set>
-#include <string>
-#include <vector>
 #include "base/basictypes.h"
-#include "phonenumbers/geocoding/area_code_map_storage_strategy.h"
 namespace i18n {
 namespace phonenumbers {
-using std::map;
-using std::set;
-using std::string;
-using std::vector;
+struct PrefixDescriptions;
 // Default area code map storage strategy that is used for data not
 // containing description duplications. It is mainly intended to avoid
 // the overhead of the string table management when it is actually
 // unnecessary (i.e no string duplication).
-class DefaultMapStorage : public AreaCodeMapStorageStrategy {
+class DefaultMapStorage {
   virtual ~DefaultMapStorage();
-  virtual int GetPrefix(int index) const;
-  virtual const string& GetDescription(int index) const;
-  virtual void ReadFromMap(const map<int, string>& area_codes);
-  virtual int GetNumOfEntries() const;
-  virtual const set<int>& GetPossibleLengths() const;
+  // Returns the phone number prefix located at the provided index.
+  int32 GetPrefix(int index) const;
+  // Gets the description corresponding to the phone number prefix located
+  // at the provided index. If the description is not available in the current
+  // language an empty string is returned.
+  const char* GetDescription(int index) const;
+  // Sets the internal state of the underlying storage implementation from the
+  // provided area_codes that maps phone number prefixes to description strings.
+  void ReadFromMap(const PrefixDescriptions* descriptions);
+  // Returns the number of entries contained in the area code map.
+  int GetNumOfEntries() const;
+  // Returns an array containing the possible lengths of prefixes sorted in
+  // ascending order.
+  const int* GetPossibleLengths() const;
+  // Returns the number of elements in GetPossibleLengths() array.
+  int GetPossibleLengthsSize() const;
   // Sorted sequence of phone number prefixes.
-  vector<int> prefixes_;
+  const int32* prefixes_;
+  int prefixes_size_;
   // Sequence of prefix descriptions, in the same order than prefixes_.
-  vector<string> descriptions_;
+  const char** descriptions_;
   // Sequence of unique possible lengths in ascending order.
-  set<int> possible_lengths_;
+  const int32* possible_lengths_;
+  int possible_lengths_size_;