Age | Commit message (Collapse) | Author |
|
For use with multithreaded implementations of Downloader and Storage, it
is desirable to work with heap-allocated objects that can easily be
passed between threads (instead of having to work with thread-local
objects that need to be copied between threads).
R=rouslan@chromium.org
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@282 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
Instead of unconditionally adding const& to the specified types, require
the user of the Callback templates to specify it. This makes it possible
to use these same templates also for other types.
Now, const int& is replaced with just plain int. Later, this will be
used to replace const std::string& with std::string*.
R=rouslan@chromium.org
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@281 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
match any part of a postal code, when it is intended to match only the prefix.
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@280 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
Author: davinci@google.com
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@265 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
R=lararennie@google.com
BUG=
Review URL: https://codereview.appspot.com/105790043
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@264 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@263 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
post-code if possible, otherwise if one is present, tries to fill in state, locality and dep-locality.
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@262 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
information from statically linked region_data_constants.
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@261 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
The current situation, where OndemandSupplier has a nested class which
is a RuleHierarchy, is an artefact from the time when OndemandSupplier
was an internal interface (r244). It does no longer make any sense.
This change makes Supplier::RuleHierarchy a simple struct and moves all
the implementation details into an internal class OndemandSupplyTask.
R=rouslan@chromium.org
BUG=
Review URL: https://codereview.appspot.com/101960046
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@260 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
This patch adds more tests for RegionDataBuilder to verify the behavior
as it's documented in the comment for RegionDataBuilder::Build() method.
TBR=roubert@google.com
Review URL: https://codereview.appspot.com/101990043
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@258 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
R=roubert@google.com
Review URL: https://codereview.appspot.com/101830044
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@256 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
This patch removes the extra whitespace from English strings. After
this patch lands, Chrome can pull in the strings and start the
translation process.
R=lararennie@google.com, roubert@google.com
Review URL: https://codereview.appspot.com/92660044
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@254 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
R=roubert@google.com
Review URL: https://codereview.appspot.com/98460048
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@250 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
R=roubert@google.com
Review URL: https://codereview.appspot.com/100630048
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@249 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@248 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
- Add Latin name and name to rule.
- Move language guessing to language object.
- Create child lookup objects.
R=lararennie@google.com
Review URL: https://codereview.appspot.com/96560045
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@247 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
With OndemandSupplier public, users of libaddressinput can choose to
create either OndemandSupplier or PreloadSupplier objects to use when
some Supplier object is needed.
R=rouslan@chromium.org
BUG=
Review URL: https://codereview.appspot.com/98450049
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@244 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
R=lararennie@google.com
Review URL: https://codereview.appspot.com/95550047
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@243 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
In the future, AddressValidator objects should always be constructed by
passing a pointer to an existing object that implements the Supplier
interface (and never construct its own Supplier internally).
R=rouslan@chromium.org
BUG=
Review URL: https://codereview.appspot.com/92550048
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@242 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
region_data_constants, rather than the metadata from the server. This is
possible now since region_data_constants is autogenerated and can be
depended on to be up-to-date (r206).
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@241 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
With this class now being an implementation of the Supplier interface
(r235) this new name better reflects that fact and its relationship to
PreloadSupplier (r236) and corresponds to the class comment:
An implementation of the Supplier interface that owns a Retriever
object, through which it loads address metadata as needed, creating Rule
objects and caching these.
R=rouslan@chromium.org
BUG=
Review URL: https://codereview.appspot.com/96540048
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@239 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
The test fixture is parametrized to be executed with different wrappers
that provide different Supplier implementations.
This verifies that both MetadataLoader and PreloadSupplier give the same
results when used for address validation.
In order to do this, add a constructor that takes Supplier* to
AddressValidator.
R=rouslan@chromium.org
BUG=
Review URL: https://codereview.appspot.com/97640045
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@238 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
Those tests in MetadataLoaderTest that should hold for all
implementations of the Supplier interface are moved into a new test
fixture Supplier, which is parametrized to be executed with different
wrappers that provide different Supplier implementations.
This verifies that both MetadataLoader and PreloadSupplier implement
this base functionality with the same results.
R=lararennie@google.com, rouslan@chromium.org
BUG=
Review URL: https://codereview.appspot.com/92560044
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@237 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
To make it possible to supply the AddressValidator with address metadata
in several different way, an interface for such a Supplier is defined
and the existing MetadataLoader is refactored to implement it.
This will be used to implement another Supplier that doesn't load any
data on demand, but only works with preloaded data.
R=rouslan@chromium.org
BUG=
Review URL: https://codereview.appspot.com/97650044
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@235 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@233 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
lines, and combining multiple street address lines into one, in a language-dependent fashion.
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@232 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
This patch changes fake data URL from test:/// to test:///plain/ and
adds a URL for fake aggregate data: test:///aggregate/.
Example of data at test:///plain/data/ZW:
{"name": "ZIMBABWE", "key": "ZW", "id": "data/ZW"}
Example of aggregate data at test:///aggregate/data/ZW:
{"data/ZW": {"name": "ZIMBABWE", "key": "ZW", "id": "data/ZW"}}
This behavior mimics the behavior of the server URLs
https://i18napis.appspot.com/ssl-address/data/ and
https://i18napis.appspot.com/ssl-aggregate-address/data/.
R=lararennie@google.com
Review URL: https://codereview.appspot.com/95560045
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@231 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
TBR=roubert@google.com
Review URL: https://codereview.appspot.com/92520047
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@230 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
TBR=roubert@google.com
Review URL: https://codereview.appspot.com/92520046
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@229 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
If a download of validation rules fails, but stale data is available,
then re-use it. Stale data is valid data that is more than 30 days
old. Valid data is data with a correct checksum.
Review URL: https://codereview.appspot.com/95500044
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@228 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@227 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@225 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
This patch is necessary for implementing synonym lookups.
R=roubert@google.com
Review URL: https://codereview.appspot.com/92440044
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@224 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
R=roubert@google.com
Review URL: https://codereview.appspot.com/97580043
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@223 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
R=lararennie@google.com
Review URL: https://codereview.appspot.com/91500047
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@221 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@218 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@217 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
This is in line with how the rest of the libaddressinput code is
designed, and it keeps both creation and deletion of RuleHierarchy
objects inside of then MetadataLoader.
(But this makes it impossible to continue using the "clever hack" of
reusing an existing RuleHierarchy object for a second Retrieve() call to
test alias resolution in the cache, so the RuleHierarchyTest.Alias test
case must be deleted.)
R=rouslan@chromium.org
BUG=
Review URL: https://codereview.appspot.com/95380045
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@212 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
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
|
|
Adds languages to many regions and removes name attribute
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@206 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
An address field will now be considered to be "empty" not only if it
actually is empty, but also if it contains nothing but whitespace.
(This matches the human perception of "empty" fields better.)
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@205 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
Addresses in some regions display the same field multiple times on an
envelope. For example, CI addresses display CEDEX twice. The
BuildComponents() function should not return multiple UI components for
the same field, because these components are used to display input
fields. There should be exactly one input field per field type.
R=lararennie@google.com, roubert@google.com
Review URL: https://codereview.appspot.com/83790043
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@204 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
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
|
|
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
|
|
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
|
|
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
|
|
These will all be used for address validation, so a Rule object needs
to be able to parse and store these fields.
The RE2 library is used to create regular expression matcher objects
from "zip" fields.
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@199 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
This function will be used to determine the maximum lookup key depth
that it makes sense to request from the address data server for a
particular region (so that not lookup keys, for which data never will
exist, unnecessarily are requested from the server).
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@197 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
This function corresponds to the existing ParseAddressFieldsFormat() but
parses the "required" field instead of the "format" field, which has a
slightly different syntax.
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@196 38ededc0-08b8-5190-f2ac-b31f878777ad
|
|
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
|