FINAL CUT
emptyfstring.h
1 /***********************************************************************
2 * emptyfstring.h - Creates an empty FString object *
3 * *
4 * This file is part of the FINAL CUT widget toolkit *
5 * *
6 * Copyright 2015-2022 Markus Gans *
7 * *
8 * FINAL CUT is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as *
10 * published by the Free Software Foundation; either version 3 of *
11 * the License, or (at your option) any later version. *
12 * *
13 * FINAL CUT is distributed in the hope that it will be useful, but *
14 * WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this program. If not, see *
20 * <http://www.gnu.org/licenses/>. *
21 ***********************************************************************/
22 
23 /* Standalone class
24  * ════════════════
25  *
26  * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
27  * ▕ emptyFString ▏
28  * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
29  */
30 
31 #ifndef EMPTYFSTRING_H
32 #define EMPTYFSTRING_H
33 
34 #if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT)
35  #error "Only <final/final.h> can be included directly."
36 #endif
37 
38 #include <iostream>
39 #include <memory>
40 
41 #include "final/util/flog.h"
42 #include "final/util/fstring.h"
43 
44 namespace finalcut
45 {
46 
47 namespace fc
48 {
49 
50 //----------------------------------------------------------------------
51 // class emptyFString
52 //----------------------------------------------------------------------
53 
54 class emptyFString final
55 {
56  public:
57  // Constructors
58  emptyFString() = default;
59 
60  inline static auto getClassName() -> FString
61  {
62  return "emptyFString";
63  }
64 
65  inline static auto get() -> const FString&
66  {
67  static const auto& empty_string = std::make_unique<FString>("");
68  return *empty_string;
69  }
70 };
71 
72 } // namespace fc
73 
74 } // namespace finalcut
75 
76 #endif // EMPTYFSTRING_H
Definition: class_template.cpp:25
Definition: fstring.h:79
Definition: emptyfstring.h:54