]> git.donarmstrong.com Git - lilypond.git/blob - lily/input-register.cc
release: 0.0.46.jcn1
[lilypond.git] / lily / input-register.cc
1 /*
2   input-register.cc -- implement Input_register
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8 #include "debug.hh"
9 #include "register.hh"
10 #include "input-register.hh"
11 Input_register::~Input_register()
12 {}
13
14 Input_register::Input_register()
15 {
16 }
17
18 bool
19 Input_register::group_b()const
20 {
21     return ireg_list_.size();
22 }
23
24 Array<String>
25 Input_register::get_nongroups_str_arr()const
26 {
27     Array<String> s_arr;
28     for (iter_top(ireg_list_, i); i.ok(); i++) {
29         if (!i->group_b())
30             s_arr.push(i->name_str_);
31     }
32     return s_arr;
33 }
34
35 Input_register*
36 Input_register::get_ireg_l(String nm)const
37 {
38     for (iter_top(ireg_list_, i); i.ok(); i++) {
39         if (i->name_str_ == nm)
40             return i;
41     }
42     return 0;
43 }
44 Array<Request_register*>
45 Input_register::get_nongroup_p_arr() const return a;
46 {
47     Array<String> sa(get_nongroups_str_arr());
48     for (int i=0; i < sa.size(); i++)
49         a.push(get_nongroup_register_p(sa[i]));
50 }
51
52 void
53 Input_register::add(Input_register *p)
54 {
55     ireg_list_.bottom().add(p);
56 }
57
58 void
59 Input_register::print() const
60 {
61 #ifndef NPRINT
62     mtor << name_str_ << " { ";
63     for (iter_top(ireg_list_, i); i.ok(); i++)
64         i->print();
65     mtor <<" }\n";
66 #endif 
67 }
68         
69
70 Input_register::Input_register(Input_register const&s)
71     : Input(s)
72 {
73     name_str_ = s.name_str_;
74     for (iter_top(s.ireg_list_, i); i.ok(); i++)
75         add(new Input_register(*i.ptr()));
76 }