LMMS
Loading...
Searching...
No Matches
Identifier.cpp
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the Water library.
5 Copyright (c) 2016 ROLI Ltd.
6 Copyright (C) 2017-2022 Filipe Coelho <falktx@falktx.com>
7
8 Permission is granted to use this software under the terms of the ISC license
9 http://www.isc.org/downloads/software-support-policy/isc-license/
10
11 Permission to use, copy, modify, and/or distribute this software for any
12 purpose with or without fee is hereby granted, provided that the above
13 copyright notice and this permission notice appear in all copies.
14
15 THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD
16 TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17 FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
18 OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
19 USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
20 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
21 OF THIS SOFTWARE.
22
23 ==============================================================================
24*/
25
26#include "Identifier.h"
27
28namespace water {
29
32
33Identifier::Identifier (const Identifier& other) noexcept : name (other.name) {}
34
36{
37 name = other.name;
38 return *this;
39}
40
41Identifier::Identifier (const std::string& nm)
42 : name (nm)
43{
44 // An Identifier cannot be created from an empty string!
45 wassert (!nm.empty());
46}
47
48Identifier::Identifier (const char* nm)
49 : name (nm)
50{
51 // An Identifier cannot be created from an empty string!
52 wassert (nm != nullptr && nm[0] != 0);
53}
54
55Identifier::Identifier (const char* start, const char* end)
56 : name (start, end > start ? end - start : 0)
57{
58 // An Identifier cannot be created from an empty string!
59 wassert (start < end);
60}
61
62}
#define noexcept
Definition DistrhoDefines.h:72
~Identifier() noexcept
Definition Identifier.cpp:31
Identifier() noexcept
Definition Identifier.cpp:30
Identifier & operator=(const Identifier &other) noexcept
Definition Identifier.cpp:35
std::string name
Definition Identifier.h:113
static const char * name
Definition pugl.h:1582
virtual ASIOError start()=0
#define wassert(expression)
Definition AudioSampleBuffer.h:33