Audacity  2.2.2
Public Member Functions | List of all members
wxFileNameWrapper Class Reference

#include <wxFileNameWrapper.h>

Inheritance diagram for wxFileNameWrapper:

Public Member Functions

 wxFileNameWrapper (const wxFileName &that)
 
 wxFileNameWrapper ()=default
 
 wxFileNameWrapper (const wxFileNameWrapper &that)=default
 
wxFileNameWrapperoperator= (const wxFileNameWrapper &that)=default
 
void swap (wxFileNameWrapper &that)
 
 wxFileNameWrapper (wxFileNameWrapper &&that)
 
wxFileNameWrapperoperator= (wxFileNameWrapper &&that)
 

Detailed Description

Definition at line 16 of file wxFileNameWrapper.h.

Constructor & Destructor Documentation

wxFileNameWrapper::wxFileNameWrapper ( const wxFileName &  that)
inlineexplicit

Definition at line 20 of file wxFileNameWrapper.h.

21  : wxFileName(that)
22  {}
wxFileNameWrapper::wxFileNameWrapper ( )
default
wxFileNameWrapper::wxFileNameWrapper ( const wxFileNameWrapper that)
default
wxFileNameWrapper::wxFileNameWrapper ( wxFileNameWrapper &&  that)
inline

Definition at line 70 of file wxFileNameWrapper.h.

References swap().

71  {
72  swap(that);
73  }
void swap(wxFileNameWrapper &that)

Member Function Documentation

wxFileNameWrapper& wxFileNameWrapper::operator= ( const wxFileNameWrapper that)
default
wxFileNameWrapper& wxFileNameWrapper::operator= ( wxFileNameWrapper &&  that)
inline

Definition at line 75 of file wxFileNameWrapper.h.

References swap().

76  {
77  if (this != &that) {
78  Clear();
79  swap(that);
80  }
81  return *this;
82  }
void swap(wxFileNameWrapper &that)
void wxFileNameWrapper::swap ( wxFileNameWrapper that)
inline

Definition at line 28 of file wxFileNameWrapper.h.

Referenced by operator=(), and wxFileNameWrapper().

29  {
30  if (this != &that) {
31 #if 0
32  // Awful hack number 1 makes gcc 5 choke
33  enum : size_t { Size = sizeof(*this) };
34  // Do it bitwise.
35  // std::aligned_storage<Size>::type buffer;
36  char buffer[Size];
37  memcpy(&buffer, this, Size);
38  memcpy(this, &that, Size);
39  memcpy(&that, &buffer, Size);
40 #else
41  // Awful hack number 2 relies on knowing the class layout
42  // This is the less evil one but watch out for redefinition of the base class
43  struct Contents
44  {
45  void swap(Contents &that) {
46  m_volume.swap(that.m_volume);
47  m_dirs.swap(that.m_dirs);
48  m_name.swap(that.m_name);
49  m_ext.swap(that.m_ext);
50  std::swap(m_relative, that.m_relative);
51  std::swap(m_hasExt, that.m_hasExt);
52  std::swap(m_dontFollowLinks, that.m_dontFollowLinks);
53  };
54 
55  wxString m_volume;
56  wxArrayString m_dirs;
57  wxString m_name, m_ext;
58  bool m_relative;
59  bool m_hasExt;
60  bool m_dontFollowLinks;
61  };
62 
63  reinterpret_cast<Contents*>(this)->swap
64  (*reinterpret_cast<Contents*>(&that));
65 #endif
66  }
67  }
void swap(wxFileNameWrapper &that)

The documentation for this class was generated from the following file: