aboutsummaryrefslogtreecommitdiff
path: root/cpp/libaddressinput.gyp
AgeCommit message (Collapse)Author
2014-05-15Use relative paths for lists of source files.rouslan@chromium.org
This patch removes the libaddressinput_dir variable and renames: libaddressinput_[test_]sources -> libaddressinput_[test_]files String values contained within lists associated with keys ending in "_files" suffix are treated as pathnames relative to the file in which they are defined. https://code.google.com/p/gyp/wiki/InputFormatReference#Pathname_Relativization R=roubert@google.com Review URL: https://codereview.appspot.com/93410044 git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@216 38ededc0-08b8-5190-f2ac-b31f878777ad
2014-05-15Compile only the library with the -fPIC flag.rouslan@chromium.org
This patch moves -fPIC flag from target defaults (for all targets) to the library target, because the unit test executable does not require it. The move is possible due to the automatic variable "_type", which contains the value of the "type" configuration for the target. https://code.google.com/p/gyp/wiki/InputFormatReference#Variables R=roubert@google.com Review URL: https://codereview.appspot.com/91470044 git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@215 38ededc0-08b8-5190-f2ac-b31f878777ad
2014-05-14Place lists of source and test files into libaddressinput.gypi.rouslan@chromium.org
This patch prevents duplication of source and test file lists in Chromium's gyp files. R=roubert@google.com Review URL: https://codereview.appspot.com/92370043 git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@213 38ededc0-08b8-5190-f2ac-b31f878777ad
2014-05-14Determine language tag and order of UI components.rouslan@chromium.org
This patch changes BuildComponents() function to read the UI language tag and determine the language tag that should be stored with the address data. The function also chooses between the default and the Latin order of UI components in the address form. A language tag is a sequence of one of more subtags separated by hyphen ("-"). All characters are in ASCII and case-insensitive. The first subtag is the base language, for example "zh". The first four-character subtag is the script, for example "Hans". git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@208 38ededc0-08b8-5190-f2ac-b31f878777ad
2014-03-31Add address metadata query functionality to libaddressinput.roubert@google.com
Specifically the utility functions IsFieldRequired() and IsFieldUsed() that answers the questions of whether a particular field is a required field or a field that is used, respectively, for a particular region. This is implemented through the class AddressValidator, which provides the public interface, and the class MetadataQueryTask which encapsulates the information necessary to perform the checking for an Is*() method that answers a yes/no question and call a callback when that has been done. The interface is asynchronous, allowing it to be used with a Downloader implementation that waits for several pending requests simultaneously. By virtue of being part of the class AddressValidator, this shares the metadata cache with address validation. (The future might show this to be a not so good design decision, but with the actual implementation isolated in class MetadataQueryTask it should be straightforward to move things around then.) git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@203 38ededc0-08b8-5190-f2ac-b31f878777ad
2014-03-21Add address validation functionality to libaddressinput.roubert@google.com
This is implemented through the class AddressValidator, which provides the public interface, and the class ValidationTask which encapsulates the information necessary to perform validation of one particular address and call a callback when that has been done. The interface is asynchronous, allowing it to be used with a Downloader implementation that waits for several pending requests simultaneously. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@202 38ededc0-08b8-5190-f2ac-b31f878777ad
2014-03-21Add the PostBoxMatchers helper class.roubert@google.com
This class contains regular expressions to match post office boxes, and a function to get the appropriate list of these to use for a particular country. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@201 38ededc0-08b8-5190-f2ac-b31f878777ad
2014-03-21Add the MetadataLoader helper class.roubert@google.com
A MetadataLoader object owns a Retriever object, through which it loads address metadata as needed, creating Rule objects and caching these. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@200 38ededc0-08b8-5190-f2ac-b31f878777ad
2014-03-21Add the LookupKey helper class.roubert@google.com
A LookupKey maps between an AddressData struct and the key string used to request address data from an address data server. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@195 38ededc0-08b8-5190-f2ac-b31f878777ad
2014-03-21Add the struct AddressData for storing address data.roubert@google.com
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@194 38ededc0-08b8-5190-f2ac-b31f878777ad
2014-03-21Add an AddressProblem enum to represent validation problems.roubert@google.com
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@193 38ededc0-08b8-5190-f2ac-b31f878777ad
2014-03-20Update the overloaded operator<< for the AddressField enum.roubert@google.com
The operator is moved out into the root namespace (where it belongs) and the implementation is updated to use a lookup table instead of a switch statement, and to output more information when encountering an invalid enum value. AddressFieldTest is added to ensure that the overloaded operator<< works as expected. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@191 38ededc0-08b8-5190-f2ac-b31f878777ad
2014-03-20Add a class NullStorage, to use when no storage is required.roubert@google.com
It is not always desirable to cache libaddressinput data. Sometimes it might give better performance characteristics to not cache. (Typically in tests or when running the data server locally.) This implementation of the Storage interface therefore doesn't actually store anything. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@189 38ededc0-08b8-5190-f2ac-b31f878777ad
2014-02-18Add re2 dependency to libaddressinput.roubert@google.com
This patch adds the re2 dependency to libaddressinput. The dependency will be used to validate postal code format of addresses. The addresses are provided by the user. The format regular expressions are from: https://i18napis.appspot.com/ssl-address For example, the US postal code has the following regular expression: \\d{5}([ \\-]\\d{4})? BUG=327046 Review URL: https://codereview.chromium.org/98543010 git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@180 38ededc0-08b8-5190-f2ac-b31f878777ad
2014-02-18Integrate SplitString into libaddressinput.roubert@google.com
This patch removes unnecessary functions and dependencies from SplitString and includes it in the build of libaddressinput. BUG=327046 Review URL: https://codereview.chromium.org/113493002 git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@179 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-12-06[cpp] Add a rule retriever.rouslan@chromium.org
This patch adds a RuleRetriever. It retrieves a rule object based on its key. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@175 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-12-06[cpp] Add validating storage.rouslan@chromium.org
This patch adds a ValidatingStorage object, which wraps any implementation of Storage by adding checksum and timestamp when saving data. When reading data, the object verifies the timestamp freshness and checksum validity. If these checks fail, then ValidatingStorage behaves as if there's no data in storage. This behavior would force a Retriever object to re-download validation rules from the server. A data timestamp is fresh if it's within a month of the current time. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@174 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-12-05[cpp] Strip dependencies from MD5 and build it.rouslan@chromium.org
This patch strips the StringPiece dependency from MD5 implementation and builds it as part of libaddressinput. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@173 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-12-05[cpp] Add a data retriever.rouslan@chromium.org
This patch adds an object to download data from a Downloader and caches the results in Storage. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@171 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-12-05[cpp] Add functions for working with lookup keys.rouslan@chromium.org
These are functions for working with lookup keys. A lookup key is a string that identifies a serialized validation rule. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@170 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-12-05[cpp] Add a fake storage to be used in tests.rouslan@chromium.org
This is a fake storage implementation to be used in tests. Instead of storing the serialized validation data on disk, it keeps them in memory for the duration of its lifetime. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@169 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-12-05[cpp] Add a fake downloader to be used in tests.rouslan@chromium.org
This is a fake downloader implementation to be used in tests. Instead of downloading serialized validation rules from the server, it reads them from a local test data file. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@168 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-11-19[cpp] Address UI.rouslan@chromium.org
This patch is part of a series of patches that enable showing an address input form. This patch adds a function to build a list of AddressUiComponents for a region code. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@163 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-11-19Modify scoped_ptr_unittest.cc to build in this environment, and use it.roubert@google.com
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@162 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-11-19[cpp] Localization object.rouslan@chromium.org
This patch is part of a series of patches that enable showing an address input form. This patch adds a Localization object, which can be used to switch between message languages or specify a custom message getter. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@160 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-11-14[cpp] Rule data structurerouslan@chromium.org
This patch is part of a series of patches that enable showing an address input form. This patch adds a rule data structure that stores rules parsed from RegionDataConstants. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@158 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-11-14[cpp] Address fieldsrouslan@chromium.org
This patch is part of a series of patches that enable showing an address input form. This patch adds an AddressField enum and functions to parse it from a format string. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@157 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-11-14[cpp] GRIT messagesrouslan@chromium.org
This patch is part of a series of patches that enable showing an address input form. This patch adds a GRIT dependency and messages. The messages come from: https://code.google.com/p/libaddressinput/source/browse/trunk/java/res/values/address_strings.xml?r=124 git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@156 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-11-14[cpp] JSON utilityrouslan@chromium.org
This patch is part of a series of patches that enable showing an address input form. This patch adds a rapidjson dependency and a wrapper. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@155 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-11-14[cpp] Region data constantsrouslan@chromium.org
This patch is part of a series of patches that enable showing an address input form. This patch adds RegionDataConstants. The data comes from: https://code.google.com/p/libaddressinput/source/browse/trunk/java/src/com/android/i18n/addressinput/RegionDataConstants.java?r=137 git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@152 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-11-13Add postbuilds for Mac OS X to set dylib path relative to executable.roubert@google.com
To make it possible to execute the unit tests directly from the build directory, without having to first set DYLD_LIBRARY_PATH or install the library, install_name_tool is executed in a postbuilds step to set the path to the library to be relative to the unit test executable (so that also the library will be loaded directly from the build directory). git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@151 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-10-11Boilerplate README and GYP file for C++ portrouslan@chromium.org
This is the boilerplate of the C++ port of the library. The configuration file is able to build an empty unit test binary. There're 3 dependencies: GYP: Generates the build files. Ninja: Executes the build files. GTest: Used for unit tests. git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@146 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-10-11Revert intermediate changes in favor of a single clean commit.rouslan@chromium.org
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@145 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-10-11Add commentsrouslan@chromium.org
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@144 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-10-11Move main to libaddressinput gyprouslan@chromium.org
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@143 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-10-11Split gtest.gyp out of libaddressinput.gyprouslan@chromium.org
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@141 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-10-11Add comment for pthread. Remove unuused include dirsrouslan@chromium.org
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@140 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-10-11Removed unnecessary filesrouslan@chromium.org
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@139 38ededc0-08b8-5190-f2ac-b31f878777ad
2013-10-11[libaddressinput-cpp] Boilerplate README and GYP filerouslan@chromium.org
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@138 38ededc0-08b8-5190-f2ac-b31f878777ad