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

#include <wxFileNameWrapper.h>

Inheritance diagram for wxFileNameWrapper:
[legend]
Collaboration diagram for wxFileNameWrapper:
[legend]

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 20 of file wxFileNameWrapper.h.

Constructor & Destructor Documentation

◆ wxFileNameWrapper() [1/4]

wxFileNameWrapper::wxFileNameWrapper ( const wxFileName &  that)
inlineexplicit

Definition at line 26 of file wxFileNameWrapper.h.

27 : wxFileName(that)
28 {}

◆ wxFileNameWrapper() [2/4]

wxFileNameWrapper::wxFileNameWrapper ( )
default

◆ wxFileNameWrapper() [3/4]

wxFileNameWrapper::wxFileNameWrapper ( const wxFileNameWrapper that)
default

◆ wxFileNameWrapper() [4/4]

wxFileNameWrapper::wxFileNameWrapper ( wxFileNameWrapper &&  that)
inline

Definition at line 76 of file wxFileNameWrapper.h.

77 {
78 swap(that);
79 }
void swap(wxFileNameWrapper &that)

References swap().

Here is the call graph for this function:

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Definition at line 81 of file wxFileNameWrapper.h.

82 {
83 if (this != &that) {
84 Clear();
85 swap(that);
86 }
87 return *this;
88 }

References swap().

Here is the call graph for this function:

◆ swap()

void wxFileNameWrapper::swap ( wxFileNameWrapper that)
inline

Definition at line 34 of file wxFileNameWrapper.h.

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

References anonymous_namespace{NoteTrack.cpp}::swap(), and swap().

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

Here is the call graph for this function:
Here is the caller graph for this function:

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