summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeat Forster <elisabethegli@beat-forsters-macbook-pro.local>2009-11-04 16:37:57 +0100
committerLukas Zeller <luz@synthesis.ch>2009-11-25 00:08:02 +0100
commit24479f7a7df264d259426b7a88257154a6cd354f (patch)
treef46b439ec0a6e10813af5c2c9e1c1ff77dce723d
parent1f8e9a836530131dd76c0b1b28533773294254da (diff)
Updates for Android
-rwxr-xr-xsrc/sysync/scriptcontext.cpp8
-rwxr-xr-xsrc/sysync_SDK/Sources/SDK_support.cpp5
-rwxr-xr-xsrc/sysync_SDK/Sources/SDK_support.h4
-rwxr-xr-xsrc/sysync_SDK/Sources/sync_dbapi.h8
4 files changed, 16 insertions, 9 deletions
diff --git a/src/sysync/scriptcontext.cpp b/src/sysync/scriptcontext.cpp
index 0777499..23a55c8 100755
--- a/src/sysync/scriptcontext.cpp
+++ b/src/sysync/scriptcontext.cpp
@@ -1096,7 +1096,7 @@ public:
// adjust
char c = *(filler.c_str()); // NUL or filler char
if (c!='0' && sign) {
- s.insert(0,1,sign); // no zero-padding: insert sign before padding
+ s.insert((size_t)0,(size_t)1,sign); // no zero-padding: insert sign before padding
sign=0; // done now
}
sInt32 n,sz = s.size() + (sign ? 1 : 0); // leave room for sign after zero padding
@@ -1106,7 +1106,7 @@ public:
if (n<0)
s.erase(0,-n); // delete at beginning
else if (n>0 && c)
- s.insert(0,n,c); // insert at beginning
+ s.insert((size_t)0,(size_t)n,c); // insert at beginning
}
else {
// left aligned field
@@ -1114,11 +1114,11 @@ public:
if (n<0)
s.erase(sz-n,-n); // delete at end
else if (n>0 && c)
- s.insert(sz,n,c); // insert at end
+ s.insert((size_t)sz,(size_t)n,c); // insert at end
}
// insert plus now if filled with zeroes
if (sign)
- s.insert(0,1,sign); // insert sign after zero padding
+ s.insert((size_t)0,(size_t)1,sign); // insert sign after zero padding
// return string
aTermP->setAsString(s);
} // func_NumFormat
diff --git a/src/sysync_SDK/Sources/SDK_support.cpp b/src/sysync_SDK/Sources/SDK_support.cpp
index 5f63bb5..81696c6 100755
--- a/src/sysync_SDK/Sources/SDK_support.cpp
+++ b/src/sysync_SDK/Sources/SDK_support.cpp
@@ -20,14 +20,13 @@
namespace sysync {
#endif
-//#define MyDB "SDK" /* local debug name */
-#define FLen 30 /* max length of (internal) item name */
+#define FLen 30 // max length of (internal) item name
// --- plugin name handling ----------------------------------------
//! recognize separation
-static bool SepFound( string name, string::size_type &pos, string sep= "!", bool backwards= false )
+bool SepFound( string name, string::size_type &pos, string sep, bool backwards )
{
if (backwards) pos= name.rfind( sep, name.length()-1 );
else pos= name.find ( sep, 0 );
diff --git a/src/sysync_SDK/Sources/SDK_support.h b/src/sysync_SDK/Sources/SDK_support.h
index b036052..331d1e5 100755
--- a/src/sysync_SDK/Sources/SDK_support.h
+++ b/src/sysync_SDK/Sources/SDK_support.h
@@ -19,6 +19,10 @@
namespace sysync {
+/*! Search for separators */
+bool SepFound( string name, string::size_type &pos, string sep= "!", bool backwards= false );
+
+
// ---- Bracket (LIB) support
/*! Returns true, if <name> belongs to an internal LIB.
* Returns false for DLL or JNI (Java Native Interface) access
diff --git a/src/sysync_SDK/Sources/sync_dbapi.h b/src/sysync_SDK/Sources/sync_dbapi.h
index a4c7345..41ed234 100755
--- a/src/sysync_SDK/Sources/sync_dbapi.h
+++ b/src/sysync_SDK/Sources/sync_dbapi.h
@@ -20,6 +20,10 @@
* be called by the SyncML engine. A linkable library is available
* (for C++) as well.
*
+ * For more detailed information about the DBApi interface
+ * please consult the SDK_manual.pdf which contains a tutorial,
+ * detailed descriptions and some example code.
+ *
* The flow for accessing the datastores is always the same:
* The SyncML engine will call these routines step by step
*
@@ -42,7 +46,6 @@
* 9) StartDataWrite
* 10) any number of random calls to:
* - InsertItem
- * - FinalizeLocalID
* - UpdateItem
* - DeleteItem
* - DeleteSyncSet
@@ -50,7 +53,8 @@
* - WriteBlob
* - ReadBlob
* - DeleteBlob
- * - [AdaptItem] (optional)
+ * - [AdaptItem] (optional)
+ * - FinalizeLocalID (at the end)
* 11) EndDataWrite
*
* 12) [Write Admin Data] (optional)