General

General API. More...

## Classes

struct | winstd::LocalFree_delete< _Ty >
| Deleter for unique_ptr using LocalFree. More...
struct | winstd::LocalFree_delete< _Ty[]>
| Deleter for unique_ptr to array of unknown size using LocalFree. More...
class | winstd::ref_unique_ptr< _Ty, _Dx >
| Helper class for returning pointers to std::unique_ptr. More...
class | winstd::ref_unique_ptr< _Ty[], _Dx >
| Helper class for returning pointers to std::unique_ptr (specialization for arrays) More...

## Macros

#define | __L(x) L ## x
| "L" stringizing macro
#define | _L(x) __L(x)
| Makes string Unicode.
#define | WINSTD_STRING_IMPL(x) #x
| Stringizing macro helper.
#define | WINSTD_STRING(x) WINSTD_STRING_IMPL(x)
| Stringizing macro.
#define | WINSTD_NONCOPYABLE(C)
| Declares a class as non-copyable. More...
#define | WINSTD_NONMOVABLE(C)
| Declares a class as non-movable. More...
#define | WINSTD_STACK_BUFFER_BYTES 1024
| Size of the stack buffer in bytes used for initial system function call. More...

## Typedefs

typedef std::string | winstd::tstring
| Multi-byte / Wide-character string (according to _UNICODE)

## Functions

template<class _Ty , class _Dx >
ref_unique_ptr< _Ty, _Dx > | winstd::get_ptr (std::unique_ptr< _Ty, _Dx > &owner) noexcept
| Helper function template for returning pointers to std::unique_ptr. More...
template<class _Ty , class _Dx >
ref_unique_ptr< _Ty[], _Dx > | winstd::get_ptr (std::unique_ptr< _Ty[], _Dx > &owner) noexcept
| Helper function template for returning pointers to std::unique_ptr (specialization for arrays) More...

## Detailed Description

General API.

## Macro Definition Documentation

## WINSTD_NONCOPYABLE

#define WINSTD_NONCOPYABLE | ( |  | C | ) |

Value:
private: \
C (_In_ const C &h) noexcept; \
C& operator=(_In_ const C &h) noexcept;

Declares a class as non-copyable.

## WINSTD_NONMOVABLE

#define WINSTD_NONMOVABLE | ( |  | C | ) |

Value:
private: \
C (_Inout_ C &&h) noexcept; \
C& operator=(_Inout_ C &&h) noexcept;

Declares a class as non-movable.

## WINSTD_STACK_BUFFER_BYTES

#define WINSTD_STACK_BUFFER_BYTES 1024

Size of the stack buffer in bytes used for initial system function call.

Some system functions with variable length output data fail for insufficient buffer sizes, and return an exact buffer length required. The function helpers use a fixed size stack buffer first. If the stack buffer really prooved sufficient, the helper allocates the exact length output on heap and copies the data without calling the system function again. Otherwise it allocates the exact length output on heap and retries.

Note
  Decrease this value in case of stack overflow.

## Function Documentation

## get_ptr() [1/2]

template<class _Ty , class _Dx >

ref_unique_ptr< _Ty, _Dx > winstd::get_ptr | ( | std::unique_ptr< _Ty, _Dx > & | owner | ) |

noexcept

Helper function template for returning pointers to std::unique_ptr.

Parameters

  [in,out] | owner | Original owner of the pointer

Returns
  A helper wrapper class to handle returning a reference to the pointer

## get_ptr() [2/2]

template<class _Ty , class _Dx >

ref_unique_ptr< _Ty[], _Dx > winstd::get_ptr | ( | std::unique_ptr< _Ty[], _Dx > & | owner | ) |

noexcept

Helper function template for returning pointers to std::unique_ptr (specialization for arrays)

Parameters

  [in,out] | owner | Original owner of the pointer

Returns
  A helper wrapper class to handle returning a reference to the pointer