Boost庫實現資料夾下所有pcd檔名稱的提取

2021-10-05 20:13:23 字數 381 閱讀 1786

下面的**使用boost庫實現資料夾下所有pcd檔名稱的提取,首先建立兩個向量pcd_files_和pcd_paths用於儲存資料夾下的點雲序列和路徑的序列。

boost::filesystem::is_directory:用於判斷傳入的引數dir_是否為目錄。

boost::filesystem::directory_iterator:結合for迴圈可以遍歷檔案path內的所有內容。

#include #include #include std::vectorpcd_files_;

std::vectorpcd_paths_;

int main()

else

}} else

}

遍歷資料夾下所有檔案

對於遍歷資料夾來說,其實並不麻煩,使用file轉化位址物件,再用file組獲取內容,其實google都差不多做好了,我就懶得廢話了,直接上 public listlist new arraylist 遍歷所有檔案 public listgetfilelist string path else ret...

獲取資料夾下所有檔案

ming xi path r c users administrator.carlos pc desktop 國防專利局 all tables 繳費明細表 彙總的繳費明細表 繳費明細表.xlsx decode utf 8 def get file path file dir,file type xl...

c 獲取資料夾下所有檔案

用c 獲取指定資料夾下的所有檔案,包括子資料夾裡的檔案。void getallfiles string path,list allfiles,bool includesubdir else while findnext hfile,fileinfo 0 findclose hfile 函式引數解釋 ...