1 // Copyright (C) 2019 Google LLC 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef ICING_UTIL_ICU_DATA_FILE_HELPER 16 #define ICING_UTIL_ICU_DATA_FILE_HELPER 17 18 #include "icing/text_classifier/lib3/utils/base/status.h" 19 20 namespace icing { 21 namespace lib { 22 23 namespace icu_data_file_helper { 24 25 // Initializes ICU using the specified absolute path to the ICU data file. 26 // The data file can either be downloaded via MDD or generated at compile time. 27 // 28 // NOTE: This target does NOT contain the ICU .dat file. To use this helper 29 // function, the calling target must include a data dependency on the .dat file 30 // and provide a valid path to that file. 31 // 32 // Returns: 33 // Ok on success 34 // INTERNAL_ERROR if failed on any errors 35 libtextclassifier3::Status SetUpIcuDataFile( 36 const std::string& icu_data_file_absolute_path); 37 38 } // namespace icu_data_file_helper 39 40 } // namespace lib 41 } // namespace icing 42 43 #endif // ICING_UTIL_ICU_DATA_FILE_HELPER 44