Coverage Report

Created: 2026-01-25 06:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/quantlib/ql/time/frequency.cpp
Line
Count
Source
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
 Copyright (C) 2004, 2005, 2006 Ferdinando Ametrano
5
 Copyright (C) 2006 Katiuscia Manzoni
6
 Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl
7
 Copyright (C) 2003, 2004, 2005, 2006, 2008 StatPro Italia srl
8
9
 This file is part of QuantLib, a free-software/open-source library
10
 for financial quantitative analysts and developers - http://quantlib.org/
11
12
 QuantLib is free software: you can redistribute it and/or modify it
13
 under the terms of the QuantLib license.  You should have received a
14
 copy of the license along with this program; if not, please email
15
 <quantlib-dev@lists.sf.net>. The license is also available online at
16
 <https://www.quantlib.org/license.shtml>.
17
18
 This program is distributed in the hope that it will be useful, but WITHOUT
19
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20
 FOR A PARTICULAR PURPOSE.  See the license for more details.
21
*/
22
23
#include <ql/time/frequency.hpp>
24
#include <ql/types.hpp>
25
#include <ql/errors.hpp>
26
27
namespace QuantLib {
28
29
0
    std::ostream& operator<<(std::ostream& out, Frequency f) {
30
0
        switch (f) {
31
0
          case NoFrequency:
32
0
            return out << "No-Frequency";
33
0
          case Once:
34
0
            return out << "Once";
35
0
          case Annual:
36
0
            return out << "Annual";
37
0
          case Semiannual:
38
0
            return out << "Semiannual";
39
0
          case EveryFourthMonth:
40
0
            return out << "Every-Fourth-Month";
41
0
          case Quarterly:
42
0
            return out << "Quarterly";
43
0
          case Bimonthly:
44
0
            return out << "Bimonthly";
45
0
          case Monthly:
46
0
            return out << "Monthly";
47
0
          case EveryFourthWeek:
48
0
            return out << "Every-fourth-week";
49
0
          case Biweekly:
50
0
            return out << "Biweekly";
51
0
          case Weekly:
52
0
            return out << "Weekly";
53
0
          case Daily:
54
0
            return out << "Daily";
55
0
          case OtherFrequency:
56
0
            return out << "Unknown frequency";
57
0
          default:
58
            QL_FAIL("unknown frequency (" << Integer(f) << ")");
59
0
        }
60
0
    }
61
62
}