Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
Configuration.h
1// trax track library
2// AD 2016
3//
4// "the resolution of all the fruitless searches"
5//
6// Peter Gabriel
7//
8// Copyright (c) 2025 Trend Redaktions- und Verlagsgesellschaft mbH
9// Copyright (c) 2019 Marc-Michael Horstmann
10//
11// Permission is hereby granted to any person obtaining a copy of this software
12// and associated source code (the "Software"), to use, view, and study the
13// Software for personal or internal business purposes, subject to the following
14// conditions:
15//
16// 1. Redistribution, modification, sublicensing, or commercial use of the
17// Software is NOT permitted without prior written consent from the copyright
18// holder.
19//
20// 2. The Software is provided "AS IS", without warranty of any kind, express
21// or implied.
22//
23// 3. All copies of the Software must retain this license notice.
24//
25// For further information, please contact: horstmann.marc@trendverlag.de
26
27#pragma once
28
29#include <ostream>
30
31#if defined( _WIN32 )
32# if defined( TRAX_STATIC_LIBRARY )
33# define dclspc
34# else
35# if defined( TRAX_DLL_LIBRARY )
36# define dclspc __declspec( dllexport )
37# else
38# define dclspc __declspec( dllimport )
39# endif
40# endif
41#else
42# define dclspc
43#endif
44
45namespace trax{
46
48 enum class Verbosity : char{
49 unknown = 0,//< unknown verbosity
50 silent, //< no messages at all
51 error, //< errors only
52 normal, //< important messages only
53 detailed, //< detailed report
54 verbose //< everything
55 };
56
57 dclspc std::string ToString( Verbosity type );
58
59 dclspc Verbosity ToVerbosity( const std::string& type ) noexcept;
60
61 dclspc void SetReportVerbosity( Verbosity verbosity ) noexcept;
62
63 dclspc Verbosity GetReportVerbosity() noexcept;
64
65 dclspc std::ostream& operator<<( std::ostream& stream, Verbosity verbosity );
66
67
68 class ReportVerbosityGuard{
69 Verbosity m_PreviousVerbosity;
70 public:
71 ReportVerbosityGuard( Verbosity verbosity ) noexcept {
72 m_PreviousVerbosity = GetReportVerbosity();
73 SetReportVerbosity( verbosity );
74 }
75 ~ReportVerbosityGuard() noexcept {
76 SetReportVerbosity( m_PreviousVerbosity );
77 }
78 };
79
80} // namespace trax
STL namespace.
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
Verbosity
Verbosity scale of trax library messages.
Definition Configuration.h:48