1 /* 2 * Copyright (c) 2024 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 LUME_DIR_H 17 #define LUME_DIR_H 18 #if defined(_WIN32) && (_WIN32) 19 /* 20 * File types 21 */ 22 #define DT_UNKNOWN 0 23 #define DT_FIFO 1 24 #define DT_CHR 2 25 #define DT_DIR 4 26 #define DT_BLK 6 27 #define DT_REG 8 28 #define DT_LNK 10 29 #define DT_SOCK 12 30 31 struct dirent { 32 unsigned char d_type; 33 char d_name[256]; 34 }; 35 struct DIR; 36 DIR* opendir(const char* path); 37 struct dirent* readdir(DIR* d); 38 void closedir(DIR* d); 39 #else 40 #include <sys/stat.h> 41 #include <sys/types.h> 42 #include <dirent.h> 43 #include <string> 44 #endif 45 #endif // LUME_DIR_H 46