본문 바로가기
반응형

IT/C++25

c++ 폴더 내의 파일 갯수 체크 출처: https://www.reddit.com/r/cpp_questions/comments/ms5ued/getting_filecount_of_a_directory_windows_10/?rdt=35812 size_t getNumberOfFilesInDirectoryRecursively(std::filesystem::path path) { size_t count = 0; std::filesystem::recursive_directory_iterator iterator(path, std::filesystem::directory_options::skip_permission_denied); for (auto& entry : iterator) { if (std::filesystem::is_regular_file(.. 2023. 12. 19.
How to perform chmod recursively? 출처: https://stackoverflow.com/questions/71249234/how-to-perform-chmod-recursively #include #include // see notes about these two lines at the bottom namespace fs = std::filesystem; // -"- void chmodr(const fs::path& path, fs::perms perm) { fs::permissions(path, perm); // set permissions on the top directory for(auto& de : fs::recursive_directory_iterator(path)) { fs::permissions(de, perm); // se.. 2023. 12. 19.
리눅스 폴더별 용량 확인하기 root@mypc:~$ du -sh * 1.2G Data 8.0K Desktop 4.0K Documents 326M Downloads 4.4M Pictures 4.0K Public 104K Templates 28M googletest 2.8G snap 1.3G temp 2023. 9. 19.
zip store (압축율 0%) 옵션으로 압축하기 zip -0 -r mydir.zip mydir 2023. 9. 12.
linux 파일에 lastmodified date 쓰기 const char *LAST_MODIFIED_FORMAT = "%Y-%m-%dT%H:%M:%SZ"; std::istringstream ss(modifiedDate); // ss.imbue(std::locale("en_US.utf-8")); std::tm modified_tm = {}; ss >> std::get_time(&modified_tm, LAST_MODIFIED_FORMAT); const std::time_t t = mktime(&modified_tm); std::filesystem::file_time_type file_time = toFileTimeType(t); std::error_code ec; std::filesystem::last_write_time(filePath, file_time,.. 2023. 9. 6.
Install Google Test and Google Mock on Ubuntu cd ~ git clone https://github.com/google/googletest.git cd googletest mkdir build && cd build cmake .. -DBUILD_SHARED_LIBS=OFF -DINSTALL_GTEST=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr cmake --build . sudo cmake --install . sudo ldconfig 참고자료: https://gist.github.com/dlime/313f74fd23e4267c4a915086b84c7d3d 2023. 8. 11.
객체에서 std::shared_ptr 얻기 std::shared_ptr pSharedPtr = std::make_shared(std::move(classObject)); 2023. 8. 7.
ASPICE 에 대해서. 이 글은 ChatGPT 를 이용하여 작성한 글입니다. ASPICE이란? ASPICE(Automotive SPICE)는 자동차 산업에서 소프트웨어 개발 프로세스를 평가하고 개선하기 위한 프레임워크입니다. 국제 소프트웨어 프로세스 개선 및 능력 평가(SPICE) 이니셔티브의 자동차 전문 이해 관계자 그룹(SIG)에서 개발되었습니다. ASPICE의 중요성은 무엇인가요? ASPICE는 소프트웨어가 현대 자동차의 중요한 구성 요소 중 하나가 되면서 자동차 산업에서 일관성, 효율성, 효과성이 있는 소프트웨어 개발 프로세스를 보장하기 위해 중요합니다. 또한 ASPICE의 사용은 고객 요구 사항을 충족시키는 고품질 안전성 있는 자동차 소프트웨어를 보장하는 데 도움이 됩니다. ASPICE의 이점은 무엇인가요? ASPIC.. 2023. 3. 30.
lambda expression 람다 식은 c++ 11 이상에서 지원된다. 이름없는 함수 객체를 정의하는 편리한 방법이다. 위 그림은 람다 식이 어떻게 구성되어 있는지 보여준다. 1번과 6번만이 필수이다. capture clause (Also known as the lambda-introducer in the C++ specification.) parameter list Optional. (Also known as the lambda declarator) mutable specification Optional. exception-specification Optional. trailing-return-type Optional. lambda body. 다음은 람다식의 예제이다. auto lamdaFunc = [](int &a) { n +=.. 2020. 9. 26.
[MFC] 특정 사용자 권한으로 공유폴더 만들기 출처 : http://forums.codeguru.com/showthread.php?231589-How-to-set-share-permissions-for-shared-folder-programmatically // CreateRTXShare.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include #include #include #include #include #pragma comment(lib, "Netapi32.lib") #define MAX_ERROR_BUFFER_SZ0xFFFF int CreateShare(LPTSTR name, LPTSTR path); TCHAR* GetErrorText(D.. 2017. 2. 10.
반응형