windows.find_file.h.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <chapter xml:id="windows.find_file.h">
  2. <title><tt>__vic/windows/find_file.h</tt></title>
  3. <chapter xml:id="windows--FindFile">
  4. <title><tt>windows::FindFile</tt></title>
  5. <code-block lang="C++">
  6. class windows::FindFile : public WIN32_FIND_DATA, private non_copyable
  7. {
  8. public:
  9. FindFile();
  10. ~FindFile();
  11. bool FindFirst(LPCTSTR filename);
  12. bool FindNext();
  13. bool IsOpen() const;
  14. void Close();
  15. bool CloseNT() noexcept;
  16. };
  17. </code-block>
  18. <p>Wrapper for Win32 API <tt>FindFirstFile()</tt>/<tt>FindNextFile()</tt>
  19. functions. Special entries <tt>.</tt> and <tt>..</tt> are newer included in
  20. the resulting set.</p>
  21. <section><title>Class members</title>
  22. <synopsis>
  23. <prototype>FindFile()</prototype>
  24. <postcondition><tt>IsOpen() == false</tt></postcondition>
  25. </synopsis>
  26. <synopsis>
  27. <prototype>~FindFile()</prototype>
  28. <p>Calls <tt>CloseNT()</tt> if <tt>IsOpen() == true</tt>.</p>
  29. </synopsis>
  30. <synopsis>
  31. <prototype>bool FindFirst(LPCTSTR filename)</prototype>
  32. <p>Calls <tt>FindFirstFile()</tt>. Returns <tt>false</tt> if no files found.
  33. Throws <xref to="windows--error"/> on other errors.</p>
  34. <precondition><tt>IsOpen() == false</tt></precondition>
  35. </synopsis>
  36. <synopsis>
  37. <prototype>bool FindNext()</prototype>
  38. <p>Calls <tt>FindNextFile()</tt>. Returns <tt>false</tt> if no more files
  39. available. Throws <xref to="windows--error"/> on other errors.</p>
  40. <precondition><tt>IsOpen() == true</tt></precondition>
  41. </synopsis>
  42. <synopsis>
  43. <prototype>bool Close()</prototype>
  44. <p>Closes the find handle. Throws <xref to="windows--error"/> on errors.</p>
  45. <precondition><tt>IsOpen() == true</tt></precondition>
  46. <postcondition><tt>IsOpen() == false</tt></postcondition>
  47. </synopsis>
  48. <synopsis>
  49. <prototype>bool CloseNT() noexcept</prototype>
  50. <p>Same as <tt>Close()</tt> but returns <tt>false</tt> instead of throwing
  51. exceptions.</p>
  52. <precondition><tt>IsOpen() == true</tt></precondition>
  53. <postcondition><tt>IsOpen() == false</tt></postcondition>
  54. </synopsis>
  55. </section>
  56. </chapter>
  57. </chapter>