⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 file_operations.hpp

📁 用STL的方式封装了WindowsAPI、COM调用、ACE、ATL、MFC、WTL等多种组件
💻 HPP
📖 第 1 页 / 共 3 页
字号:

/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///
/// \param from The file to delete
/// \param progressTitle String to be displayed describing the operation
/// \param bAborted A Boolean that will indicate whether the operation was aborted
///
/// \note Throws std::bad_alloc on allocation failure on translators that support it
///
/// \note The flag FOF_SIMPLEPROGRESS is automatically added if progressTitle is non-NULL
///
/// \return A status code indicating the success of the operation
///
/// \retval 0 The operation completed successfully
/// \retval ERROR_NOT_ENOUGH_MEMORY This is returned only when compiling with translators that do not support throwing std::bad_alloc on memory allocation failure
/// \retval !0 Any other Win32 error code
inline int shell_delete(ws_char_a_t const *from, ws_char_a_t const *progressTitle, ws_bool_t &bAborted)
{
    return shell_delete_a_(NULL, from, progressTitle, 0, &bAborted);
}

/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///
/// \param from The file to delete
/// \param progressTitle String to be displayed describing the operation
/// \param flags One or more of the FILEOP_FLAGS values.
///
/// \note Throws std::bad_alloc on allocation failure on translators that support it
///
/// \note The FOF_WANTMAPPINGHANDLE flag is always ignored. The flag FOF_SIMPLEPROGRESS is automatically added if progressTitle is non-NULL
///
/// \return A status code indicating the success of the operation
///
/// \retval 0 The operation completed successfully
/// \retval ERROR_NOT_ENOUGH_MEMORY This is returned only when compiling with translators that do not support throwing std::bad_alloc on memory allocation failure
/// \retval !0 Any other Win32 error code
inline int shell_delete(ws_char_a_t const *from, ws_char_a_t const *progressTitle, FILEOP_FLAGS flags)
{
    return shell_delete_a_(NULL, from, progressTitle, flags, NULL);
}

/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///
/// \param from The file to delete
/// \param progressTitle String to be displayed describing the operation
/// \param flags One or more of the FILEOP_FLAGS values.
/// \param bAborted A Boolean that will indicate whether the operation was aborted
///
/// \note Throws std::bad_alloc on allocation failure on translators that support it
///
/// \note The FOF_WANTMAPPINGHANDLE flag is always ignored. The flag FOF_SIMPLEPROGRESS is automatically added if progressTitle is non-NULL
///
/// \return A status code indicating the success of the operation
///
/// \retval 0 The operation completed successfully
/// \retval ERROR_NOT_ENOUGH_MEMORY This is returned only when compiling with translators that do not support throwing std::bad_alloc on memory allocation failure
/// \retval !0 Any other Win32 error code
inline int shell_delete(ws_char_a_t const *from, ws_char_a_t const *progressTitle, FILEOP_FLAGS flags, ws_bool_t &bAborted)
{
    return shell_delete_a_(NULL, from, progressTitle, flags, &bAborted);
}

/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///
/// \param hwnd Handle to the window that will act as the parent to any dialogs displayed
/// \param from The file to delete
///
/// \note Throws std::bad_alloc on allocation failure on translators that support it
///
/// \return A status code indicating the success of the operation
///
/// \retval 0 The operation completed successfully
/// \retval ERROR_NOT_ENOUGH_MEMORY This is returned only when compiling with translators that do not support throwing std::bad_alloc on memory allocation failure
/// \retval !0 Any other Win32 error code
inline int shell_delete(HWND hwnd, ws_char_a_t const *from)
{
    return shell_delete_a_(hwnd, from, NULL, 0, NULL);
}

/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///
/// \param hwnd Handle to the window that will act as the parent to any dialogs displayed
/// \param from The file to delete
/// \param bAborted A Boolean that will indicate whether the operation was aborted
///
/// \note Throws std::bad_alloc on allocation failure on translators that support it
///
/// \return A status code indicating the success of the operation
///
/// \retval 0 The operation completed successfully
/// \retval ERROR_NOT_ENOUGH_MEMORY This is returned only when compiling with translators that do not support throwing std::bad_alloc on memory allocation failure
/// \retval !0 Any other Win32 error code
inline int shell_delete(HWND hwnd, ws_char_a_t const *from, ws_bool_t &bAborted)
{
    return shell_delete_a_(hwnd, from, NULL, 0, &bAborted);
}

/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///
/// \param hwnd Handle to the window that will act as the parent to any dialogs displayed
/// \param from The file to delete
/// \param flags One or more of the FILEOP_FLAGS values.
///
/// \note Throws std::bad_alloc on allocation failure on translators that support it
///
/// \note The FOF_WANTMAPPINGHANDLE flag is always ignored.
///
/// \return A status code indicating the success of the operation
///
/// \retval 0 The operation completed successfully
/// \retval ERROR_NOT_ENOUGH_MEMORY This is returned only when compiling with translators that do not support throwing std::bad_alloc on memory allocation failure
/// \retval !0 Any other Win32 error code
inline int shell_delete(HWND hwnd, ws_char_a_t const *from, FILEOP_FLAGS flags)
{
    return shell_delete_a_(hwnd, from, NULL, flags, NULL);
}

/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///
/// \param hwnd Handle to the window that will act as the parent to any dialogs displayed
/// \param from The file to delete
/// \param flags One or more of the FILEOP_FLAGS values.
/// \param bAborted A Boolean that will indicate whether the operation was aborted
///
/// \note Throws std::bad_alloc on allocation failure on translators that support it
///
/// \note The FOF_WANTMAPPINGHANDLE flag is always ignored.
///
/// \return A status code indicating the success of the operation
///
/// \retval 0 The operation completed successfully
/// \retval ERROR_NOT_ENOUGH_MEMORY This is returned only when compiling with translators that do not support throwing std::bad_alloc on memory allocation failure
/// \retval !0 Any other Win32 error code
inline int shell_delete(HWND hwnd, ws_char_a_t const *from, FILEOP_FLAGS flags, ws_bool_t &bAborted)
{
    return shell_delete_a_(hwnd, from, NULL, flags, &bAborted);
}

/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///
/// \param hwnd Handle to the window that will act as the parent to any dialogs displayed
/// \param from The file to delete
/// \param progressTitle String to be displayed describing the operation
///
/// \note Throws std::bad_alloc on allocation failure on translators that support it
///
/// \note The flag FOF_SIMPLEPROGRESS is automatically added if progressTitle is non-NULL
///
/// \return A status code indicating the success of the operation
///
/// \retval 0 The operation completed successfully
/// \retval ERROR_NOT_ENOUGH_MEMORY This is returned only when compiling with translators that do not support throwing std::bad_alloc on memory allocation failure
/// \retval !0 Any other Win32 error code
inline int shell_delete(HWND hwnd, ws_char_a_t const *from, ws_char_a_t const *progressTitle)
{
    return shell_delete_a_(hwnd, from, progressTitle, 0, NULL);
}

/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///
/// \param hwnd Handle to the window that will act as the parent to any dialogs displayed
/// \param from The file to delete
/// \param progressTitle String to be displayed describing the operation
/// \param bAborted A Boolean that will indicate whether the operation was aborted
///
/// \note Throws std::bad_alloc on allocation failure on translators that support it
///
/// \note The flag FOF_SIMPLEPROGRESS is automatically added if progressTitle is non-NULL
///
/// \return A status code indicating the success of the operation
///
/// \retval 0 The operation completed successfully
/// \retval ERROR_NOT_ENOUGH_MEMORY This is returned only when compiling with translators that do not support throwing std::bad_alloc on memory allocation failure
/// \retval !0 Any other Win32 error code
inline int shell_delete(HWND hwnd, ws_char_a_t const *from, ws_char_a_t const *progressTitle, ws_bool_t &bAborted)
{
    return shell_delete_a_(hwnd, from, progressTitle, 0, &bAborted);
}

/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///
/// \param hwnd Handle to the window that will act as the parent to any dialogs displayed
/// \param from The file to delete
/// \param progressTitle String to be displayed describing the operation
/// \param flags One or more of the FILEOP_FLAGS values.
///
/// \note Throws std::bad_alloc on allocation failure on translators that support it
///
/// \note The FOF_WANTMAPPINGHANDLE flag is always ignored. The flag FOF_SIMPLEPROGRESS is automatically added if progressTitle is non-NULL
///
/// \return A status code indicating the success of the operation
///
/// \retval 0 The operation completed successfully
/// \retval ERROR_NOT_ENOUGH_MEMORY This is returned only when compiling with translators that do not support throwing std::bad_alloc on memory allocation failure
/// \retval !0 Any other Win32 error code
inline int shell_delete(HWND hwnd, ws_char_a_t const *from, ws_char_a_t const *progressTitle, FILEOP_FLAGS flags)
{
    return shell_delete_a_(hwnd, from, progressTitle, flags, NULL);
}

/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///
/// \param hwnd Handle to the window that will act as the parent to any dialogs displayed
/// \param from The file to delete
/// \param progressTitle String to be displayed describing the operation
/// \param flags One or more of the FILEOP_FLAGS values.
/// \param bAborted A Boolean that will indicate whether the operation was aborted
///
/// \note Throws std::bad_alloc on allocation failure on translators that support it
///
/// \note The FOF_WANTMAPPINGHANDLE flag is always ignored. The flag FOF_SIMPLEPROGRESS is automatically added if progressTitle is non-NULL
///
/// \return A status code indicating the success of the operation
///
/// \retval 0 The operation completed successfully
/// \retval ERROR_NOT_ENOUGH_MEMORY This is returned only when compiling with translators that do not support throwing std::bad_alloc on memory allocation failure
/// \retval !0 Any other Win32 error code
inline int shell_delete(HWND hwnd, ws_char_a_t const *from, ws_char_a_t const *progressTitle, FILEOP_FLAGS flags, ws_bool_t &bAborted)
{
    return shell_delete_a_(hwnd, from, progressTitle, flags, &bAborted);
}



/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///
/// \param from The file to delete
///
/// \note Throws std::bad_alloc on allocation failure on translators that support it
///
/// \return A status code indicating the success of the operation
///
/// \retval 0 The operation completed successfully
/// \retval ERROR_NOT_ENOUGH_MEMORY This is returned only when compiling with translators that do not support throwing std::bad_alloc on memory allocation failure
/// \retval !0 Any other Win32 error code
inline int shell_delete(ws_char_w_t const *from)
{
    return shell_delete_w_(NULL, from, NULL, 0, NULL);
}

/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///
/// \param from The file to delete
/// \param bAborted A Boolean that will indicate whether the operation was aborted
///
/// \note Throws std::bad_alloc on allocation failure on translators that support it
///
/// \return A status code indicating the success of the operation
///
/// \retval 0 The operation completed successfully
/// \retval ERROR_NOT_ENOUGH_MEMORY This is returned only when compiling with translators that do not support throwing std::bad_alloc on memory allocation failure
/// \retval !0 Any other Win32 error code
inline int shell_delete(ws_char_w_t const *from, ws_bool_t &bAborted)
{
    return shell_delete_w_(NULL, from, NULL, 0, &bAborted);
}

/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///
/// \param from The file to delete
/// \param flags One or more of the FILEOP_FLAGS values.
///
/// \note Throws std::bad_alloc on allocation failure on translators that support it
///
/// \note The FOF_WANTMAPPINGHANDLE flag is always ignored.
///
/// \return A status code indicating the success of the operation
///
/// \retval 0 The operation completed successfully
/// \retval ERROR_NOT_ENOUGH_MEMORY This is returned only when compiling with translators that do not support throwing std::bad_alloc on memory allocation failure
/// \retval !0 Any other Win32 error code
inline int shell_delete(ws_char_w_t const *from, FILEOP_FLAGS flags)
{
    return shell_delete_w_(NULL, from, NULL, flags, NULL);
}

/// \brief Requests the shell to delete the given file
///
/// \ingroup group__library__windows_shell
///

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -