OLD | NEW |
1 // Copyright 2013 Google Inc. | 1 // Copyright 2013 Google Inc. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not | 3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not |
4 // use this file except in compliance with the License. You may obtain a copy of | 4 // use this file except in compliance with the License. You may obtain a copy of |
5 // the License at | 5 // the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | 10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | 11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
12 // License for the specific language governing permissions and limitations under | 12 // License for the specific language governing permissions and limitations under |
13 // the License. | 13 // the License. |
14 | 14 |
15 #include "liblouis_instance.h" | 15 #include "liblouis_instance.h" |
16 | 16 |
17 #include <cstdio> | 17 #include <cstdio> |
18 #include <cstring> | 18 #include <cstring> |
19 #include <sys/mount.h> | 19 #include <sys/mount.h> |
20 #include <vector> | 20 #include <vector> |
21 | 21 |
22 #include "nacl_io/nacl_io.h" | 22 #include "native_client_sdk/src/libraries/nacl_io/nacl_io.h" |
23 #include "ppapi/c/pp_errors.h" | 23 #include "ppapi/c/pp_errors.h" |
24 #include "ppapi/cpp/module.h" | 24 #include "ppapi/cpp/module.h" |
25 | 25 |
26 #include "translation_result.h" | 26 #include "translation_result.h" |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 static const char kHexadecimalChars[] = "0123456789abcdef"; | 30 static const char kHexadecimalChars[] = "0123456789abcdef"; |
31 | 31 |
32 // Converts a vector of bytes into a (lowercase) hexadecimal string. | 32 // Converts a vector of bytes into a (lowercase) hexadecimal string. |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 bool success = liblouis_.BackTranslate(table_names, cells, &text); | 314 bool success = liblouis_.BackTranslate(table_names, cells, &text); |
315 Json::Value reply(Json::objectValue); | 315 Json::Value reply(Json::objectValue); |
316 reply[kSuccessKey] = success; | 316 reply[kSuccessKey] = success; |
317 if (success) { | 317 if (success) { |
318 reply[kTextKey] = text; | 318 reply[kTextKey] = text; |
319 } | 319 } |
320 PostReply(reply, message_id); | 320 PostReply(reply, message_id); |
321 } | 321 } |
322 | 322 |
323 } // namespace liblouis_nacl | 323 } // namespace liblouis_nacl |
OLD | NEW |