Please use these standards while doing programming for LilyPond
-
-
Functions and methods do not return errorcodes, but use assert for
checking status.
=head2 DATA MEMBERS
- Class::member
-
-if the member's name resembles its type, then I use
+ Class::member()
+ Class::member_type_()
- class Fubular { ..}
-
- Class::fubular_
+the C<type> is a Hungarian notation postfix
=head2 COMMENTS
+The source is commented in the DOC++ style. Check out doc++ at
+F<http://www.ZIB-Berlin.DE/VisPar/doc++/doc++.html>
+
/// short description
class Class {
///
Command* get_meter_command(int,int);
+Command get_defaultbar_command();
+void split_bar_command(Command &pre_com, Command &no_break_com, Command &post_com,String s);
#endif // GETCOMMAND_HH
#define INPUTCOMMAND_HH
#include "proto.hh"
#include "scalar.hh"
-#include "vray.hh"
+#include "varray.hh"
#include "moment.hh"
struct Input_command {
/// analogous to argv[]
- svec<Scalar> args;
+ Array<Scalar> args;
void print()const;
Input_command();
operator Command();
};
-
-Input_command* get_meterchange_command( int,int);
-Input_command* get_key_interpret_command(svec<int >);
-Input_command* get_clef_interpret_command(String w);
+Input_command *get_meterchange_command( int,int);
+Input_command *get_key_interpret_command(Array<int >);
+Input_command *get_clef_interpret_command(String w);
Input_command *get_reset_command();
Input_command *get_partial_command(Moment u);
Input_command *get_skip_command(int,Moment);
-Input_command *get_grouping_command(svec<int>);
-Input_command *get_bar_command( );
-
-svec<int> get_default_grouping(int count);
+Input_command *get_grouping_command(Array<int>);
+Input_command *get_bar_command(String);
+Input_command *get_newmeasure_command();
+Array<int> get_default_grouping(int count);
#endif // INPUTCOMMAND_HH
Input_command::operator Command()
{
Command c;
- if (!args.sz())
+ if (!args.size())
return c;
c.code = INTERPRET;
}
Input_command*
-get_grouping_command(svec<int>a )
+get_grouping_command(Array<int>a )
{
Input_command*c = new Input_command;
c->args.add("GROUPING");
- for (int i=0; i < a.sz(); i ++)
+ for (int i=0; i < a.size(); i ++)
c->args.add(a[i]);
return c;
}
Input_command*
-get_key_interpret_command(svec<int >a )
+get_key_interpret_command(Array<int >a )
{
Input_command*c = new Input_command;
c->args.add("KEY");
- for (int i=0; i < a.sz(); i ++) {
+ for (int i=0; i < a.size(); i ++) {
c->args.add(a[i]);
}
return c;
}
Input_command *
-get_bar_command()
+get_newmeasure_command()
{
Input_command*c = new Input_command;
- c->args.add( "BAR");
- c->args.add( "|");
+ c->args.add( "NEWMEASURE");
return c;
}
Input_command::print()const
{
mtor << "{ ";
- if (args.sz()) {
+ if (args.size()) {
mtor<< " args: ";
- for (int i = 0; i<args.sz(); i++)
+ for (int i = 0; i<args.size(); i++)
mtor << "`"<<args[i] <<"',";
}
mtor << "}\n";
return c;
}
-svec<int>
+Input_command*
+get_bar_command(String w)
+{
+ Input_command*c = new Input_command;
+ c->args.add("BAR");
+ c->args.add(w);
+ return c;
+}
+
+Array<int>
get_default_grouping(int count)
{
- svec<int> s;
+ Array<int> s;
if (!(count % 3 )) {
for (int i=0; i < count/3; i++)
s.add(3);