diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2009-07-25 19:52:22 -0700 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2009-07-25 21:15:25 -0700 |
commit | 2af1b3db3d4f687d008db74b150f149e956b4bc6 (patch) | |
tree | 39d7d5bf15667c01f9b6dfe02bdd0e7fa36cd303 /tools/localize | |
parent | 8ecb36eec61f119f500a805b82438aadb3396a19 (diff) | |
parent | cf4550c3198d6b3d92cdc52707fe70d7cc0caa9f (diff) | |
download | frameworks_base-2af1b3db3d4f687d008db74b150f149e956b4bc6.zip frameworks_base-2af1b3db3d4f687d008db74b150f149e956b4bc6.tar.gz frameworks_base-2af1b3db3d4f687d008db74b150f149e956b4bc6.tar.bz2 |
Merge korg/donut into korg/master
Diffstat (limited to 'tools/localize')
-rw-r--r-- | tools/localize/Android.mk | 1 | ||||
-rw-r--r-- | tools/localize/Perforce.cpp | 1 | ||||
-rw-r--r-- | tools/localize/SourcePos.cpp | 1 | ||||
-rw-r--r-- | tools/localize/file_utils.cpp | 37 | ||||
-rw-r--r-- | tools/localize/localize_test.cpp | 1 | ||||
-rw-r--r-- | tools/localize/merge_res_and_xliff.cpp | 1 | ||||
-rw-r--r-- | tools/localize/merge_res_and_xliff_test.cpp | 2 | ||||
-rw-r--r-- | tools/localize/xmb.cpp | 1 |
8 files changed, 42 insertions, 3 deletions
diff --git a/tools/localize/Android.mk b/tools/localize/Android.mk index 186177f..ab79f8d 100644 --- a/tools/localize/Android.mk +++ b/tools/localize/Android.mk @@ -53,4 +53,3 @@ ifeq (a,a) endif include $(BUILD_HOST_EXECUTABLE) - diff --git a/tools/localize/Perforce.cpp b/tools/localize/Perforce.cpp index a7f301e..ae11231 100644 --- a/tools/localize/Perforce.cpp +++ b/tools/localize/Perforce.cpp @@ -1,6 +1,7 @@ #include "Perforce.h" #include "log.h" #include <string.h> +#include <cstdio> #include <stdlib.h> #include <sstream> #include <sys/types.h> diff --git a/tools/localize/SourcePos.cpp b/tools/localize/SourcePos.cpp index dd54f3a..184bfe0 100644 --- a/tools/localize/SourcePos.cpp +++ b/tools/localize/SourcePos.cpp @@ -1,6 +1,7 @@ #include "SourcePos.h" #include <stdarg.h> +#include <cstdio> #include <set> #include <cstdio> diff --git a/tools/localize/file_utils.cpp b/tools/localize/file_utils.cpp index c0981d8..775ce2f 100644 --- a/tools/localize/file_utils.cpp +++ b/tools/localize/file_utils.cpp @@ -1,17 +1,52 @@ #include <string.h> +#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "file_utils.h" #include "Perforce.h" +#include <utils/String8.h> #include <sys/fcntl.h> #include <sys/stat.h> #include <errno.h> #include <string.h> #include <stdlib.h> #include <cstdio> -#include <host/Directories.h> #include "log.h" +using namespace android; +using namespace std; + +static string +parent_dir(const string& path) +{ + return string(String8(path.c_str()).getPathDir().string()); +} + +static int +mkdirs(const char* last) +{ + String8 dest; + const char* s = last-1; + int err; + do { + s++; + if (s > last && (*s == '.' || *s == 0)) { + String8 part(last, s-last); + dest.appendPath(part); +#ifdef HAVE_MS_C_RUNTIME + err = _mkdir(dest.string()); +#else + err = mkdir(dest.string(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP); +#endif + if (err != 0) { + return err; + } + last = s+1; + } + } while (*s); + return 0; +} + string translated_file_name(const string& file, const string& locale) { diff --git a/tools/localize/localize_test.cpp b/tools/localize/localize_test.cpp index 931ea95..1d0ac9a 100644 --- a/tools/localize/localize_test.cpp +++ b/tools/localize/localize_test.cpp @@ -2,6 +2,7 @@ #include "XLIFFFile.h" #include "ValuesFile.h" #include "localize.h" +#include <stdio.h> int pseudolocalize_xliff(XLIFFFile* xliff, bool expand); diff --git a/tools/localize/merge_res_and_xliff.cpp b/tools/localize/merge_res_and_xliff.cpp index 58a6554..1fdaa0e 100644 --- a/tools/localize/merge_res_and_xliff.cpp +++ b/tools/localize/merge_res_and_xliff.cpp @@ -3,6 +3,7 @@ #include "file_utils.h" #include "Perforce.h" #include "log.h" +#include <stdio.h> static set<StringResource>::const_iterator find_id(const set<StringResource>& s, const string& id, int index) diff --git a/tools/localize/merge_res_and_xliff_test.cpp b/tools/localize/merge_res_and_xliff_test.cpp index f638a74..6fe2629 100644 --- a/tools/localize/merge_res_and_xliff_test.cpp +++ b/tools/localize/merge_res_and_xliff_test.cpp @@ -1,6 +1,6 @@ #include <cstdio> #include "merge_res_and_xliff.h" - +#include <stdio.h> int merge_test() diff --git a/tools/localize/xmb.cpp b/tools/localize/xmb.cpp index 236705f..d8f6ff0 100644 --- a/tools/localize/xmb.cpp +++ b/tools/localize/xmb.cpp @@ -7,6 +7,7 @@ #include "XLIFFFile.h" #include <map> +#include <cstdio> using namespace std; |