1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 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 16 #ifndef PREFERENCES_ERRNO_H 17 #define PREFERENCES_ERRNO_H 18 19 #include <errno.h> 20 21 namespace OHOS { 22 namespace NativePreferences { 23 constexpr int E_OK = 0; 24 constexpr int E_BASE = -1000; // different from the other errno. 25 constexpr int E_ERROR = (E_BASE - 1); 26 constexpr int E_STALE = (E_BASE - 2); // Resource has been stopped, killed or destroyed. 27 constexpr int E_INVALID_ARGS = (E_BASE - 3); // the input args is invalid. 28 constexpr int E_OUT_OF_MEMORY = (E_BASE - 4); // out of memory 29 constexpr int E_NOT_PERMIT = (E_BASE - 5); // operation is not permitted 30 constexpr int E_KEY_EMPTY = (E_BASE - 6); 31 constexpr int E_KEY_EXCEED_MAX_LENGTH = (E_BASE - 7); 32 constexpr int E_PTR_EXIST_ANOTHER_HOLDER = (E_BASE - 8); 33 constexpr int E_DELETE_FILE_FAIL = (E_BASE - 9); 34 constexpr int E_EMPTY_FILE_PATH = (E_BASE - 10); 35 constexpr int E_RELATIVE_PATH = (E_BASE - 11); 36 constexpr int E_EMPTY_FILE_NAME = (E_BASE - 12); 37 constexpr int E_INVALID_FILE_PATH = (E_BASE - 13); 38 constexpr int E_PATH_EXCEED_MAX_LENGTH = (E_BASE - 14); 39 constexpr int E_VALUE_EXCEED_MAX_LENGTH = (E_BASE - 15); 40 constexpr int E_KEY_EXCEED_LENGTH_LIMIT = (E_BASE - 16); 41 constexpr int E_VALUE_EXCEED_LENGTH_LIMIT = (E_BASE - 17); 42 constexpr int E_DEFAULT_EXCEED_LENGTH_LIMIT = (E_BASE - 18); 43 constexpr int E_NAPI_GET_ERROR = (E_BASE - 19); 44 45 } // namespace NativePreferences 46 } // namespace OHOS 47 #endif // PREFERENCES_ERRNO_H 48