Make ThrowException visible

Change-Id: Ic1f978e6c6104b6759a9b80a616549d83fec3e0c
Reviewed-on: http://review.couchbase.org/19546
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Use C++ exceptions instead of CPP macros

We could just as well throw an exception instead
of having macros with return statements in them.

Change-Id: I8c92516a7a9ac8ac25c4a223f855554a4c11f7fa
Reviewed-on: http://review.couchbase.org/19547
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Move operation functions to their own file

Change-Id: I633f521e8b129a1c6a5222c860e32d5838788ccd
Reviewed-on: http://review.couchbase.org/19571
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Let parse() return true (bugfix)

Change-Id: I863a23395b3b0a6dc92109e02eeb65fef20eb385
Reviewed-on: http://review.couchbase.org/19594
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Queue operations internally until connect succeeds.

This change makes dealing with operations nicer by providing a unified
set of semantics for scheduling.

Operations are scheduled once, and retried. If an operation fails with
an error, its callback will always be invoked

Change-Id: I391897d4b88edb3bb9dd06fe0d431937dd8f22c3
Reviewed-on: http://review.couchbase.org/19607
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Fix CAS handling:

- Cas is 64 bits, but v8 doesn't have 64 bit js ints - we need an object
- Positional cas argument parsing reads the wrong argument

Change-Id: Icaabf3d393feb38001b39794923b2e5b00109b51
Reviewed-on: http://review.couchbase.org/19649
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Fix exception message formatting

Change-Id: I62cf72856a4c722c78232e1355e9cc4aef3d7c42
Reviewed-on: http://review.couchbase.org/19650
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Run the reformat target

Change-Id: I20d49baf11fa2674ac5b58122f8973116b845ef1
Reviewed-on: http://review.couchbase.org/19695
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Untabify the list (use M-q in emacs to fixup)

Change-Id: I1defa425d382386c5fec16add811393542f80947
Reviewed-on: http://review.couchbase.org/19696
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Update js examples

Change-Id: Idd360b1936c041dfe809cc5659dfe87cfc2d1b3a
Reviewed-on: http://review.couchbase.org/19707
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Cleanup JS test code

- Allow arguments for connection and test parameters
- Unify positional and dictionary calling styles

Change-Id: Ia7e5fa0181366ebffe19f6f3667cdfac61461049
Reviewed-on: http://review.couchbase.org/19709
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Refactor: don't expose internal variables

Change-Id: Iddcd1770c987998c881b62879476b729cca3d09e
Reviewed-on: http://review.couchbase.org/19721
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
Add headers for emacs to enable C++ mode

Change-Id: I3b9dad8d2cfef05f997409082e983b4e89d9fa28
Reviewed-on: http://review.couchbase.org/19722
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
Refactor: C++ify function names

Change-Id: I014a58fefa51f544c8e29072f09e60ac219ba41a
Reviewed-on: http://review.couchbase.org/19723
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Refactor: Try to make it look a bit more c++y

Change-Id: I053c72b84eb7a677ad13fe737a5ae217176d20e3
Reviewed-on: http://review.couchbase.org/19724
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Refactor: protect member variables

Change-Id: I02885a002a1a80895b0bef601767c62e04810218
Reviewed-on: http://review.couchbase.org/19725
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
Make cas/expiry parsing more tolerant of false-ish values

Change-Id: I8b4779e50ba6e06a2c62892fe1f58f44288da7be
Reviewed-on: http://review.couchbase.org/19718
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Fix ::AsciiValue usage error

Encapsulated char is dynamically allocated and goes out of scope
when the ::AsciiValue's dtor is called, so keep the value in scope

Change-Id: If6e3eeed28e1870ee5dd157caac4e443659948c4
Reviewed-on: http://review.couchbase.org/19719
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Add basic unit tests and check Makefile target

Change-Id: I6d5489fc29ed260f1d3c981b0310441fb04c559b
Reviewed-on: http://review.couchbase.org/19720
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>