Coverage Report

Created: 2025-11-04 06:12

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/quantlib/ql/time/calendars/southkorea.hpp
Line
Count
Source
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
 Copyright (C) 2004 FIMAT Group
5
 Copyright (C) 2007 StatPro Italia srl
6
 Copyright (C) 2008 Charles Chongseok Hyun
7
 Copyright (C) 2015 Riccardo Barone
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
/*! \file southkorea.hpp
24
    \brief South Korean calendars
25
*/
26
27
#ifndef quantlib_south_korean_calendar_hpp
28
#define quantlib_south_korean_calendar_hpp
29
30
#include <ql/time/calendar.hpp>
31
32
namespace QuantLib {
33
34
    //! South Korean calendars
35
    /*! Public holidays:
36
        <ul>
37
        <li>Saturdays</li>
38
        <li>Sundays</li>
39
        <li>New Year's Day, January 1st</li>
40
        <li>Independence Day, March 1st</li>
41
        <li>Arbour Day, April 5th (until 2005)</li>
42
        <li>Labour Day, May 1st</li>
43
        <li>Children's Day, May 5th</li>
44
        <li>Memorial Day, June 6th</li>
45
        <li>Constitution Day, July 17th (until 2007)</li>
46
        <li>Liberation Day, August 15th</li>
47
        <li>National Fondation Day, October 3th</li>
48
        <li>Hangeul Day, October 9th (from 2013)</li>
49
        <li>Christmas Day, December 25th</li>
50
        </ul>
51
52
        Other holidays for which no rule is given
53
        (data available for 2004-2050 only:)
54
        <ul>
55
        <li>Lunar New Year, the last day of the previous lunar year</li>
56
        <li>Election Days</li>
57
        <li>National Assemblies</li>
58
        <li>Presidency</li>
59
        <li>Regional Election Days</li>
60
        <li>Buddha's birthday</li>
61
        <li>Harvest Moon Day</li>
62
        </ul>
63
64
        Holidays for the Korea exchange
65
        (data from
66
        <http://eng.krx.co.kr/> or
67
        <http://www.dooriworld.com/daishin/holiday/holiday.html>
68
        <https://www.law.go.kr/%EB%B2%95%EB%A0%B9/%EA%B4%80%EA%B3%B5%EC%84%9C%EC%9D%98%20%EA%B3%B5%ED%9C%B4%EC%9D%BC%EC%97%90%20%EA%B4%80%ED%95%9C%20%EA%B7%9C%EC%A0%95>):
69
        <ul>
70
        <li>Public holidays as listed above</li>
71
        <li>Year-end closing</li>
72
        <li>Occasional closing days</li>
73
        </ul>
74
75
        \ingroup calendars
76
    */
77
    class SouthKorea : public Calendar {
78
      private:
79
        class SettlementImpl : public Calendar::Impl {
80
          public:
81
0
            std::string name() const override { return "South-Korean settlement"; }
82
            bool isWeekend(Weekday) const override;
83
            bool isBusinessDay(const Date&) const override;
84
        };
85
        class KrxImpl final : public SettlementImpl {
86
          public:
87
0
            std::string name() const override { return "South-Korea exchange"; }
88
            bool isBusinessDay(const Date&) const override;
89
        };
90
      public:
91
        enum Market { Settlement,  //!< Public holidays
92
                      KRX          //!< Korea exchange
93
        };
94
        SouthKorea(Market m = KRX);
95
    };
96
97
}
98
99
100
#endif