+2006-02-11 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * flower/include/std-string.hh:
+ * flower/include/std-vector.hh: Finish std:: conversion; move
+ flower extensions from std:: namespace. Update users.
+
+ * lily/include/lily-proto.hh: Replace Link_array__*_ macros by
+ their expansion to vector<*>. Update users.
+
2006-02-10 Graham Percival <gpermus@gmail.com>
* Documentation/user/invoking.itely: add example to File structure.
#endif
#ifdef __CYGWIN__
-static std::string
-dos_to_posix (std::string file_name)
+static string
+dos_to_posix (string file_name)
{
char buf[PATH_MAX] = "";
char *s = file_name.get_copy_str0 ();
#if 0
static /* avoid warning */
#endif
-std::string
-slashify (std::string file_name)
+string
+slashify (string file_name)
{
replace_all (file_name, '\\', '/');
- replace_all (file_name, std::string ("//"), "/");
+ replace_all (file_name, string ("//"), "/");
return file_name;
}
/* Join components to full file_name. */
-std::string
+string
File_name::to_string () const
{
- std::string s;
+ string s;
if (!root_.empty ())
- s = root_ + std::to_string (ROOTSEP);
+ s = root_ + ::to_string (ROOTSEP);
if (!dir_.empty ())
{
s += dir_;
if (!base_.empty () || !ext_.empty ())
- s += std::to_string (DIRSEP);
+ s += ::to_string (DIRSEP);
}
s += base_;
if (!ext_.empty ())
- s += std::to_string (EXTSEP) + ext_;
+ s += ::to_string (EXTSEP) + ext_;
return s;
}
-File_name::File_name (std::string file_name)
+File_name::File_name (string file_name)
{
#ifdef __CYGWIN__
/* All system functions would work, even if we do not convert to
#include <cstdio>
#include <cerrno>
-using namespace std;
#include "config.hh"
#if HAVE_SYS_STAT_H
#define PATHSEP ':'
#endif
-std::vector<std::string>
+vector<string>
File_path::directories () const
{
return dirs_;
#include <algorithm>
void
-File_path::parse_path (std::string p)
+File_path::parse_path (string p)
{
ssize len;
while ((len = p.length ()))
if (i == NPOS)
i = len;
append (p.substr (0, i));
- p = p.substr (std::min (len, i + 1));
+ p = p.substr (min (len, i + 1));
}
}
bool
-is_file (std::string file_name)
+is_file (string file_name)
{
#if !STAT_MACROS_BROKEN
struct stat sbuf;
}
bool
-is_dir (std::string file_name)
+is_dir (string file_name)
{
#if !STAT_MACROS_BROKEN
struct stat sbuf;
@return
The file name if found, or empty string if not found. */
-std::string
-File_path::find (std::string name) const
+string
+File_path::find (string name) const
{
if (!name.length () || (name == "-"))
return name;
for (vsize i = 0; i < dirs_.size (); i++)
{
File_name file_name (name);
- File_name dir = (std::string) dirs_[i];
+ File_name dir = (string) dirs_[i];
file_name.root_ = dir.root_;
dir.root_ = "";
if (file_name.dir_.empty ())
file_name.dir_ = dir.to_string ();
else if (!dir.to_string ().empty ())
file_name.dir_ = dir.to_string ()
- + std::to_string (DIRSEP) + file_name.dir_;
+ + ::to_string (DIRSEP) + file_name.dir_;
if (is_file (file_name.to_string ()))
return file_name.to_string ();
}
where EXT is from EXTENSIONS.
*/
-std::string
-File_path::find (std::string name, char const *extensions[])
+string
+File_path::find (string name, char const *extensions[])
{
if (name.empty () || name == "-")
return name;
File_name file_name (name);
- std::string orig_ext = file_name.ext_;
+ string orig_ext = file_name.ext_;
for (int i = 0; extensions[i]; i++)
{
file_name.ext_ = orig_ext;
if (*extensions[i] && !file_name.ext_.empty ())
file_name.ext_ += ".";
file_name.ext_ += extensions[i];
- std::string found = find (file_name.to_string ());
+ string found = find (file_name.to_string ());
if (!found.empty ())
return found;
}
/** Append a directory, return false if failed. */
bool
-File_path::try_append (std::string s)
+File_path::try_append (string s)
{
if (s == "")
s = ".";
return false;
}
-std::string
+string
File_path::to_string () const
{
- std::string s;
+ string s;
for (vsize i = 0; i < dirs_.size (); i++)
{
s = s + dirs_[i];
if (i < dirs_.size () - 1)
- s += std::to_string (PATHSEP);
+ s += ::to_string (PATHSEP);
}
return s;
}
void
-File_path::append (std::string str)
+File_path::append (string str)
{
dirs_.push_back (str);
}
void
-File_path::prepend (std::string str)
+File_path::prepend (string str)
{
dirs_.insert (dirs_.begin (), str);
}
return found_option_;
}
-std::string
+string
Long_option_init::to_string () const
{
- std::string str;
+ string str;
if (shortname_char_)
str += "-" + shortname_char_;
if (shortname_char_ && longname_str0_)
str += ", ";
if (longname_str0_)
- str += std::string ("`--") + longname_str0_ + "'";
+ str += string ("`--") + longname_str0_ + "'";
return str;
}
-std::string
+string
Long_option_init::str_for_help () const
{
- std::string s;
+ string s;
if (shortname_char_)
- s = "-" + std::to_string (shortname_char_);
+ s = "-" + ::to_string (shortname_char_);
else
s = " ";
if (!error_out_)
return;
- std::string str = arg_value_char_a_a_[0];
+ string str = arg_value_char_a_a_[0];
str += ": ";
switch (c)
{
break;
case E_UNKNOWNOPTION:
str += _f ("unrecognized option: `%s'",
- std::string (argument_index_
- ? std::string ("-" + std::string (1, arg_value_char_a_a_[array_index_][argument_index_]))
- : std::string (arg_value_char_a_a_[array_index_])));
+ string (argument_index_
+ ? string ("-" + string (1, arg_value_char_a_a_[array_index_][argument_index_]))
+ : string (arg_value_char_a_a_[array_index_])));
break;
case E_ILLEGALARG:
str += _f ("invalid argument `%s' to option `%s'",
const int EXTRA_SPACES = 5;
-std::string
+string
Long_option_init::table_string (Long_option_init *l)
{
- std::string tabstr = "";
+ string tabstr = "";
int wid = 0;
for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++)
- wid = std::max (int(wid), int(l[i].str_for_help ().length ()));
+ wid = max (int(wid), int(l[i].str_for_help ().length ()));
for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++)
{
- std::string s = " " + l[i].str_for_help ();
- s += std::string (wid - s.length () + EXTRA_SPACES, ' ');
+ string s = " " + l[i].str_for_help ();
+ s += string (wid - s.length () + EXTRA_SPACES, ' ');
- std::string help_text (gettext (l[i].help_str0_));
+ string help_text (gettext (l[i].help_str0_));
replace_all (help_text, "\n",
- "\n" + std::string (wid + EXTRA_SPACES + 2, ' '));
+ "\n" + string (wid + EXTRA_SPACES + 2, ' '));
tabstr += s + help_text + "\n";
}
class File_name
{
public:
- std::string root_;
- std::string dir_;
- std::string base_;
- std::string ext_;
+ string root_;
+ string dir_;
+ string base_;
+ string ext_;
- File_name (std::string);
+ File_name (string);
bool is_absolute () const;
- std::string to_string () const;
+ string to_string () const;
};
#endif /* FILE_NAME */
class File_path
{
- std::vector<std::string> dirs_;
+ vector<string> dirs_;
public:
- std::vector<std::string> directories () const;
- std::string find (std::string name) const;
- std::string find (std::string name, char const *extensions[]);
- std::string to_string () const;
- bool try_append (std::string str);
- void append (std::string str);
- void parse_path (std::string);
- void prepend (std::string str);
+ vector<string> directories () const;
+ string find (string name) const;
+ string find (string name, char const *extensions[]);
+ string to_string () const;
+ bool try_append (string str);
+ void append (string str);
+ void parse_path (string);
+ void prepend (string str);
};
-bool is_file (std::string file_name);
-bool is_dir (std::string file_name);
+bool is_file (string file_name);
+bool is_dir (string file_name);
#endif /* FILE_PATH */
template<class K, class V> struct Hash_table_iter;
typedef unsigned char Byte;
-namespace std {
- struct String_data;
- struct String_handle;
- //template<class T> struct Array;
- template<class T> struct Link_array;
-}
struct String_convert;
+#if 0
+namespace std {
+struct string;
+template<typename T> struct vector;
+}
+#else
#include "std-string.hh"
#include "std-vector.hh"
+#endif
+using namespace std;
+
#include "real.hh"
template<class T> struct Link_list;
char const *help_str0_;
- std::string to_string () const;
- std::string str_for_help () const;
+ string to_string () const;
+ string str_for_help () const;
// NO constructor!
static int compare (Long_option_init const &, Long_option_init const &);
- static std::string table_string (Long_option_init *);
+ static string table_string (Long_option_init *);
};
/** C++ for version of long_getopt. For processing GNU style command
/**
Internationalisation: _ ("to be translated") gets "translated" by GNU gettext
*/
-std::string _ (char const *ch);
+string _ (char const *ch);
/**
Internationalisation: _f ("Usage: %s [FILE]", "lilypond") gets "translated" by
GNU gettext
*/
-std::string _f (char const *format, ...);
-std::string _f (char const *format, std::string s, std::string s2 = "", std::string s3 = "");
+string _f (char const *format, ...);
+string _f (char const *format, string s, string s2 = "", string s3 = "");
#endif // INTERNATIONAL_HH
*/
struct Interval_set
{
- std::vector<Interval> allowed_regions_;
+ vector<Interval> allowed_regions_;
Interval_set ();
void set_full ();
Drul_array<T>::at;
static T infinity ();
- static std::string T_to_string (T arg);
+ static string T_to_string (T arg);
T center () const;
void translate (T t)
{
Drul_array<Real> da (at (LEFT), at (RIGHT));
return ::linear_combination (da, x);
}
- std::string to_string () const;
+ string to_string () const;
bool contains (T r) const;
void negate ()
}
template<class T>
-std::string
+string
Interval_t<T>::to_string () const
{
if (is_empty ())
return "[empty]";
- std::string s ("[");
+ string s ("[");
- return (s + T_to_string (at (LEFT)) + std::string (",")
- + T_to_string (at (RIGHT)) + std::string ("]"));
+ return (s + T_to_string (at (LEFT)) + string (",")
+ + T_to_string (at (RIGHT)) + string ("]"));
}
template<class T>
coordinate_a_[X_AXIS] = coordinate_a_[Y_AXIS] = 0.0;
}
- std::string to_string () const;
+ string to_string () const;
Offset &mirror (Axis a)
{
using namespace std;
template<class T>
-class Link_array : public std::vector<T *>
+class Link_array : public vector<T *>
{
};
int degree ()const;
/// coefficients
- std::vector<Real> coefs_;
+ vector<Real> coefs_;
// leading coef
Real &lc ();
Real lc () const;
void print () const;
Real eval (Real) const;
- void print_sols (std::vector<Real>) const;
- void check_sols (std::vector<Real>) const;
+ void print_sols (vector<Real>) const;
+ void check_sols (vector<Real>) const;
void check_sol (Real x) const;
static Polynomial multiply (const Polynomial &p1, const Polynomial &p2);
static Polynomial power (int exponent, const Polynomial &src);
void debug_clean ();
- std::vector<Real> solve_quadric ()const;
- std::vector<Real> solve_cubic ()const;
- std::vector<Real> solve_linear ()const;
+ vector<Real> solve_quadric ()const;
+ vector<Real> solve_cubic ()const;
+ vector<Real> solve_linear ()const;
- std::vector<Real> solve () const;
+ vector<Real> solve () const;
};
IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, -);
template<class T>
class PQueue
{
- std::vector<T> heap_array_;
+ vector<T> heap_array_;
T &elt (vsize i)
{
return heap_array_[i - 1];
Rational &operator %= (Rational);
static int compare (Rational const &, Rational const &);
int sign () const;
- std::string to_string () const;
+ string to_string () const;
};
#include "arithmetic-operator.hh"
#include <climits>
/*
- MacOS 10.3 uses g++ 3.3 which doesn't have std::isinf()
+ MacOS 10.3 uses g++ 3.3 which doesn't have isinf()
*/
// #include <cmath>
#include <math.h>
/*
- std-string.hh -- declare std::string
+ std-string.hh -- declare string
source file of the GNU LilyPond music typesetter
#include <string>
-namespace std {
+using namespace std;
- typedef size_t ssize;
-#define NPOS std::string::npos
+typedef size_t ssize;
+#define NPOS string::npos
- string to_string (string s);
- string to_string (char c, int n = 1);
- string to_string (int i, char const *format = 0);
- string to_string (double f, char const *format = 0);
- string to_string (long);
- string to_string (long unsigned);
- string to_string (unsigned);
- string to_string (bool b);
- string to_string (char const *format, ...);
+string to_string (string s);
+string to_string (char c, int n=1);
+string to_string (int i, char const *format=0);
+string to_string (double f, char const *format=0);
+string to_string (long);
+string to_string (long unsigned);
+string to_string (unsigned);
+string to_string (bool b);
+string to_string (char const *format, ...);
- string &replace_all (string &str, string find, string replace);
- string &replace_all (string &str, char find, char replace);
- char *string_copy (string s);
-
- int string_compare (string const &, string const &);
+string &replace_all (string &str, string find, string replace);
+string &replace_all (string &str, char find, char replace);
+char *string_copy (string s);
+
+int string_compare (string const &, string const &);
- INSTANTIATE_COMPARE (string const &, string_compare);
-}
+INSTANTIATE_COMPARE (string const &, string_compare);
#endif /* STD_STRING_HH */
/*
- std-vector.hh -- declare std::vector
+ std-vector.hh -- declare vector
source file of the GNU LilyPond music typesetter
#include <functional> /* unary_function */
#include <cassert>
+using namespace std;
+
#if HAVE_BOOST_LAMBDA
#include <boost/lambda/lambda.hpp>
#endif
template<typename T>
int default_compare (T const &a, T const &b)
{
- if (a < b)
- return -1;
- else if (a > b)
- return 1;
- else
- return 0;
+ if (a < b)
+ return -1;
+ else if (a > b)
+ return 1;
+ else
+ return 0;
}
template<typename T>
#include "compare.hh"
#include "config.hh"
+#ifndef VSIZE
+#define VSIZE
+typedef size_t vsize;
+#define VPOS UINT_MAX
+#endif
+
#if HAVE_STL_DATA_METHOD
#include <vector>
#else /* !HAVE_STL_DATA_METHOD */
namespace std {
- #ifndef VSIZE
- #define VSIZE
- typedef size_t vsize;
- #define VPOS UINT_MAX
- #endif
-
/* Interface without pointer arithmetic (iterator) semantics. */
template<typename T>
class vector : public __vector<T>
}
while (*hi - *lo > 1);
}
-}
+} /* namespace std */
#endif /* !HAVE_STL_DATA_METHOD */
-namespace std {
-
- #ifndef VSIZE
- #define VSIZE
- typedef size_t vsize;
- #define VPOS UINT_MAX
- #endif
-
- template<typename T>
- T const &
- boundary (vector<T> const &v, int dir, vsize i)
- {
- assert (dir);
- return v[dir == -1 ? i : v.size () - 1 - i];
- }
+template<typename T>
+T const &
+boundary (vector<T> const &v, int dir, vsize i)
+{
+ assert (dir);
+ return v[dir == -1 ? i : v.size () - 1 - i];
+}
- template<typename T>
- T &
- boundary (vector<T> &v, int dir, vsize i)
- {
- assert (dir);
- return v[dir == -1 ? i : v.size () - 1 - i];
- }
+template<typename T>
+T &
+boundary (vector<T> &v, int dir, vsize i)
+{
+ assert (dir);
+ return v[dir == -1 ? i : v.size () - 1 - i];
+}
- template<typename T>
- T const &
- back (vector<T> const &v, vsize i)
- {
- return v[v.size () - i - 1];
- }
+template<typename T>
+T const &
+back (vector<T> const &v, vsize i)
+{
+ return v[v.size () - i - 1];
+}
- template<typename T>
- T&
- back (vector<T> &v, vsize i)
- {
- return v[v.size () - i - 1];
- }
+template<typename T>
+T&
+back (vector<T> &v, vsize i)
+{
+ return v[v.size () - i - 1];
+}
- template<typename T>
- void
- concat (vector<T> &v, vector<T> const& w)
- {
- v.insert (v.end (), w.begin (), w.end ());
- }
+template<typename T>
+void
+concat (vector<T> &v, vector<T> const& w)
+{
+ v.insert (v.end (), w.begin (), w.end ());
+}
- template<class T>
- void
- binary_search_bounds (vector<T> const &table,
- T const &key, int (*compare) (T const &, T const &),
- vsize *lo,
- vsize *hi)
- {
- if (*lo >= *hi)
- return;
+template<class T>
+void
+binary_search_bounds (vector<T> const &table,
+ T const &key, int (*compare) (T const &, T const &),
+ vsize *lo,
+ vsize *hi)
+{
+ if (*lo >= *hi)
+ return;
- int cmp;
- int result;
+ int cmp;
+ int result;
- /* binary search */
- do
- {
- cmp = (*lo + *hi) / 2;
+ /* binary search */
+ do
+ {
+ cmp = (*lo + *hi) / 2;
- result = (*compare) (key, table[cmp]);
+ result = (*compare) (key, table[cmp]);
- if (result < 0)
- *hi = cmp;
- else
- *lo = cmp;
- }
- while (*hi - *lo > 1);
- }
+ if (result < 0)
+ *hi = cmp;
+ else
+ *lo = cmp;
+ }
+ while (*hi - *lo > 1);
+}
#if 0
- /* FIXME: what if COMPARE is named: int operator == (T const&, T const&),
- wouldn't that work for most uses of BINARY_SEARCH?
- */
- template<typename T>
- vsize
- binary_search (vector<T> const &v,
- T const &key, int (*compare) (T const &, T const &),
- vsize b=0, vsize e=VPOS)
- {
- if (e == VPOS)
- e = v.size ();
- typename vector<T>::const_iterator i = find (v.begin () + b,
- v.begin () + e,
- key);
- if (i != v.end ())
- return i - v.begin ();
- return VPOS;
- }
+/* FIXME: what if COMPARE is named: int operator == (T const&, T const&),
+ wouldn't that work for most uses of BINARY_SEARCH?
+*/
+template<typename T>
+vsize
+binary_search (vector<T> const &v,
+ T const &key, int (*compare) (T const &, T const &),
+ vsize b=0, vsize e=VPOS)
+{
+ if (e == VPOS)
+ e = v.size ();
+ typename vector<T>::const_iterator i = find (v.begin () + b,
+ v.begin () + e,
+ key);
+ if (i != v.end ())
+ return i - v.begin ();
+ return VPOS;
+}
#else // c&p from array.icc; cannot easily use stl_algo:find b.o. compare func.
- template<class T>
- vsize
- binary_search (vector<T> const &table,
- T const &key,
- int (*compare) (T const &, T const &),
- vsize lo=0,
- vsize hi=VPOS)
- {
- if (hi == VPOS)
- hi = table.size ();
+template<class T>
+vsize
+binary_search (vector<T> const &table,
+ T const &key,
+ int (*compare) (T const &, T const &),
+ vsize lo=0,
+ vsize hi=VPOS)
+{
+ if (hi == VPOS)
+ hi = table.size ();
- if (lo >= hi)
- return VPOS;
+ if (lo >= hi)
+ return VPOS;
- binary_search_bounds (table, key, compare, &lo, &hi);
+ binary_search_bounds (table, key, compare, &lo, &hi);
- if (! (*compare) (key, table[lo]))
- return lo;
+ if (! (*compare) (key, table[lo]))
+ return lo;
- /* not found */
- return VPOS;
- }
+ /* not found */
+ return VPOS;
+}
#endif
#if 0
- /* FIXME: the COMPARE functionality is broken? */
- template<typename T>
- void
- vector_sort (vector<T> &v, int (*compare) (T const &, T const &),
- vsize lower=VPOS, vsize upper=VPOS)
- {
- typename vector<T>::iterator b = v.begin ();
- typename vector<T>::iterator e = v.begin ();
- if (lower == VPOS)
- {
- lower = 0;
- upper = v.size ();
- }
- ::std::sort (b + lower, e + upper, compare);
- }
+/* FIXME: the COMPARE functionality is broken? */
+template<typename T>
+void
+vector_sort (vector<T> &v, int (*compare) (T const &, T const &),
+ vsize lower=VPOS, vsize upper=VPOS)
+{
+ typename vector<T>::iterator b = v.begin ();
+ typename vector<T>::iterator e = v.begin ();
+ if (lower == VPOS)
+ {
+ lower = 0;
+ upper = v.size ();
+ }
+ sort (b + lower, e + upper, compare);
+}
#else
- // ugh, c&p
- template<typename T> void
- vector_sort (vector<T> &v, int (*compare) (T const &, T const &),
- vsize lower=VPOS, vsize upper=VPOS)
- {
- if (lower == VPOS)
- {
- lower = 0;
- upper = v.size () - 1;
+// ugh, c&p
+template<typename T> void
+vector_sort (vector<T> &v, int (*compare) (T const &, T const &),
+ vsize lower=VPOS, vsize upper=VPOS)
+{
+ if (lower == VPOS)
+ {
+ lower = 0;
+ upper = v.size () - 1;
}
- if (upper == VPOS || lower >= upper)
- return;
- swap (v[lower], v[(lower + upper) / 2]);
- vsize last = lower;
- for (vsize i = lower +1; i <= upper; i++)
- if (compare (v[i], v[lower]) < 0)
- swap (v[++last], v[i]);
- swap (v[lower], v[last]);
- vector_sort (v, compare, lower, last - 1);
- vector_sort (v, compare, last + 1, upper);
- }
+ if (upper == VPOS || lower >= upper)
+ return;
+ swap (v[lower], v[(lower + upper) / 2]);
+ vsize last = lower;
+ for (vsize i = lower +1; i <= upper; i++)
+ if (compare (v[i], v[lower]) < 0)
+ swap (v[++last], v[i]);
+ swap (v[lower], v[last]);
+ vector_sort (v, compare, lower, last - 1);
+ vector_sort (v, compare, last + 1, upper);
+}
#endif
- template<typename T>
- void
- reverse (vector<T> &v)
- {
- // CHECKME: for a simple vector, like vector<int>, this should
- // expand to memrev.
- ::std::reverse (v.begin (), v.end ());
- }
+template<typename T>
+void
+reverse (vector<T> &v)
+{
+ // CHECKME: for a simple vector, like vector<int>, this should
+ // expand to memrev.
+ reverse (v.begin (), v.end ());
+}
- template<typename T>
- void
- uniq (vector<T> &v)
- {
- v.erase (unique (v.begin (), v.end ()), v.end ());
- }
+template<typename T>
+void
+uniq (vector<T> &v)
+{
+ v.erase (unique (v.begin (), v.end ()), v.end ());
+}
- template<typename T>
- typename vector<T>::const_iterator
- find (vector<T> const &v, T const &key)
- {
- return ::std::find (v.begin (), v.end (), key);
- }
+template<typename T>
+typename vector<T>::const_iterator
+find (vector<T> const &v, T const &key)
+{
+ return find (v.begin (), v.end (), key);
+}
#if HAVE_BOOST_LAMBDA
#include <boost/lambda/lambda.hpp>
- using namespace boost::lambda;
- template<typename T>
- void
- junk_pointers (vector<T> &v)
- {
- for_each (v.begin (), v.end (), (delete _1, _1 = 0));
- v.clear ();
- }
+using namespace boost::lambda;
+template<typename T>
+void
+junk_pointers (vector<T> &v)
+{
+ for_each (v.begin (), v.end (), (delete _1, _1 = 0));
+ v.clear ();
+}
#else
- template<typename T> struct del : public unary_function<T, void>
- {
- void operator() (T x)
- {
- delete x;
- x = 0;
- }
- };
-
- template<typename T>
- void
- junk_pointers (vector<T> &v)
+template<typename T> struct del : public unary_function<T, void>
+{
+ void operator() (T x)
{
- // Hmm.
- ::std::for_each (v.begin (), v.end (), del<T> ());
- v.clear ();
+ delete x;
+ x = 0;
}
-#endif /* HAVE_BOOST_LAMBDA */
+};
+template<typename T>
+void
+junk_pointers (vector<T> &v)
+{
+ // Hmm.
+ for_each (v.begin (), v.end (), del<T> ());
+ v.clear ();
}
-
-using namespace std;
+#endif /* HAVE_BOOST_LAMBDA */
#endif /* STD_VECTOR_HH */
#include "std-string.hh"
#include "flower-proto.hh"
-/** The functor std::string_convert handles all conversions to/from std::string
+/** The functor string_convert handles all conversions to/from string
(some time, anyway). The class is quite empty from data view. */
class String_convert
{
- static int hex2bin (std::string hex_string, std::string &bin_string_r);
+ static int hex2bin (string hex_string, string &bin_string_r);
static int hex2nibble (Byte byte);
static Byte nibble2hex_byte (Byte byte);
public:
- static std::string pad_to (std::string s, int length);
- static std::string bool_string (bool b);
- static std::string bin2dec (std::string bin_string);
- static std::string bin2hex (std::string bin_string);
- static std::string dec2bin (std::string str);
- static int bin2int (std::string bin_string);
- static unsigned bin2unsigned (std::string bin_string);
- static std::string char_string (char c, int n);
- static int dec2int (std::string dec_string);
- static double dec2double (std::string dec_string);
- static std::string double_string (double f, char const *fmt = 0);
- static std::string form_string (char const *format, ...);
- static std::string vform_string (char const *format, va_list args);
- static int hex2int (std::string str);
- static unsigned hex2unsigned (std::string str);
- static std::string hex2bin (std::string str);
- static std::string int_string (int i, char const *fmt = 0);
- static std::string unsigned_string (unsigned);
- static std::string long_string (long);
- static std::string int2hex (int i, int length_i, char ch);
- static std::string unsigned2hex (unsigned u, ssize length, char ch);
- static std::string int2dec (int i, int length_i, char ch);
- static std::string rational_string (Rational);
- static std::string pointer_string (void const *);
- static std::string precision_string (double x, int n);
- static std::vector<std::string> split (std::string str, char c);
- static std::string i64_string (I64, char const *fmt = 0);
- static std::string to_lower (std::string s);
- static std::string to_upper (std::string s);
- static std::string reverse (std::string s);
+ static string pad_to (string s, int length);
+ static string bool_string (bool b);
+ static string bin2dec (string bin_string);
+ static string bin2hex (string bin_string);
+ static string dec2bin (string str);
+ static int bin2int (string bin_string);
+ static unsigned bin2unsigned (string bin_string);
+ static string char_string (char c, int n);
+ static int dec2int (string dec_string);
+ static double dec2double (string dec_string);
+ static string double_string (double f, char const *fmt = 0);
+ static string form_string (char const *format, ...);
+ static string vform_string (char const *format, va_list args);
+ static int hex2int (string str);
+ static unsigned hex2unsigned (string str);
+ static string hex2bin (string str);
+ static string int_string (int i, char const *fmt = 0);
+ static string unsigned_string (unsigned);
+ static string long_string (long);
+ static string int2hex (int i, int length_i, char ch);
+ static string unsigned2hex (unsigned u, ssize length, char ch);
+ static string int2dec (int i, int length_i, char ch);
+ static string rational_string (Rational);
+ static string pointer_string (void const *);
+ static string precision_string (double x, int n);
+ static vector<string> split (string str, char c);
+ static string i64_string (I64, char const *fmt = 0);
+ static string to_lower (string s);
+ static string to_upper (string s);
+ static string reverse (string s);
};
#endif // __STRING_CONVERT_HH //
#include "std-string.hh"
-void error (std::string s);
-void message (std::string s);
-void non_fatal_error (std::string);
-void programming_error (std::string s);
-void progress_indication (std::string s);
-void warning (std::string s);
+void error (string s);
+void message (string s);
+void non_fatal_error (string);
+void programming_error (string s);
+void progress_indication (string s);
+void warning (string s);
#endif /* WARN_HH */
#include <libintl.h>
#endif
-std::string
+string
_ (char const *ch)
{
- return std::string (gettext (ch));
+ return string (gettext (ch));
}
-std::string
+string
_f (char const *format, ...)
{
va_list args;
va_start (args, format);
- std::string str = String_convert::vform_string (gettext (format), args);
+ string str = String_convert::vform_string (gettext (format), args);
va_end (args);
return str;
}
-std::string
-_f (char const *format, std::string s, std::string s2, std::string s3)
+string
+_f (char const *format, string s, string s2, string s3)
{
return String_convert::form_string (gettext (format), s.c_str (), s2.c_str (),
s3.c_str ());
}
template<>
-std::string
+string
Interval_t<Real>::T_to_string (Real r)
{
- return std::to_string (r);
+ return ::to_string (r);
}
template<>
}
template<>
-std::string
+string
Interval_t<int>::T_to_string (int i)
{
- return std::to_string (i);
+ return ::to_string (i);
}
template INTERVAL__INSTANTIATE (int);
#ifndef STANDALONE
-std::string
+string
Offset::to_string () const
{
- std::string s;
- s = std::string (" (") + std::to_string (coordinate_a_[X_AXIS]) + ", "
- + std::to_string (coordinate_a_[Y_AXIS]) + ")";
+ string s;
+ s = string (" (") + ::to_string (coordinate_a_[X_AXIS]) + ", "
+ + ::to_string (coordinate_a_[Y_AXIS]) + ")";
return s;
}
#endif
}
void
-Polynomial::check_sols (std::vector<Real> roots) const
+Polynomial::check_sols (vector<Real> roots) const
{
for (vsize i = 0; i < roots.size (); i++)
check_sol (roots[i]);
return !r;
}
-std::vector<Real>
+vector<Real>
Polynomial::solve_cubic ()const
{
- std::vector<Real> sol;
+ vector<Real> sol;
/* normal form: x^3 + Ax^2 + Bx + C = 0 */
Real A = coefs_[2] / coefs_[3];
/*
all roots of quadratic eqn.
*/
-std::vector<Real>
+vector<Real>
Polynomial::solve_quadric ()const
{
- std::vector<Real> sol;
+ vector<Real> sol;
/* normal form: x^2 + px + q = 0 */
Real p = coefs_[1] / (2 * coefs_[2]);
Real q = coefs_[0] / coefs_[2];
}
/* solve linear equation */
-std::vector<Real>
+vector<Real>
Polynomial::solve_linear ()const
{
- std::vector<Real> s;
+ vector<Real> s;
if (coefs_[1])
s.push_back (-coefs_[0] / coefs_[1]);
return s;
}
-std::vector<Real>
+vector<Real>
Polynomial::solve () const
{
Polynomial *me = (Polynomial *) this;
case 3:
return solve_cubic ();
}
- std::vector<Real> s;
+ vector<Real> s;
return s;
}
return (*this += r);
}
-std::string
+string
Rational::to_string () const
{
if (is_infinity ())
{
- std::string s (sign_ > 0 ? "" : "-");
- return std::string (s + "infinity");
+ string s (sign_ > 0 ? "" : "-");
+ return string (s + "infinity");
}
- std::string s = std::to_string (num ());
+ string s = ::to_string (num ());
if (den () != 1 && num ())
- s += "/" + std::to_string (den ());
+ s += "/" + ::to_string (den ());
return s;
}
#include "std-string.hh"
#include "string-convert.hh"
-namespace std {
-
- std::string
- to_string (std::string s)
- {
- return s;
- }
-
- std::string
- to_string (char c, int n)
- {
- return std::string (max (n, 0), c);
- }
-
- std::string
- to_string (double f, char const *format)
- {
- return String_convert::double_string (f, format);
- }
-
- std::string
- to_string (int i, char const *format)
- {
- return String_convert::int_string (i, format);
- }
-
- std::string
- to_string (bool b)
- {
- return String_convert::bool_string (b);
- }
-
- std::string
- to_string (long b)
- {
- return String_convert::long_string (b);
- }
-
- std::string
- to_string (long unsigned b)
- {
- return String_convert::unsigned_string (b);
- }
-
- std::string
- to_string (unsigned u)
- {
- return String_convert::unsigned_string (u);
- }
-
- std::string
- to_string (char const *format, ...)
- {
- va_list args;
- va_start (args, format);
- std::string str = String_convert::vform_string (format, args);
- va_end (args);
- return str;
- }
-
- std::string &
- replace_all (std::string &str, std::string find, std::string replace)
- {
- ssize len = find.length ();
- for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + len))
- str = str.replace (i, len, replace);
- return str;
- }
-
- std::string &
- replace_all (std::string &str, char find, char replace)
- {
- for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + 1))
- str[i] = replace;
- return str;
- }
-
- char *
- string_copy (std::string s)
- {
- ssize len = s.length ();
- char *dest = new char[len + 1];
- //s.copy (dest, len + 1);
- memcpy (dest, s.c_str (), len + 1);
- return dest;
- }
-
- int
- string_compare (std::string const &a, std::string const &b)
- {
- return a.compare (b);
- }
+string
+to_string (string s)
+{
+ return s;
+}
+
+string
+to_string (char c, int n)
+{
+ return string (max (n, 0), c);
+}
+
+string
+to_string (double f, char const *format)
+{
+ return String_convert::double_string (f, format);
+}
+
+string
+to_string (int i, char const *format)
+{
+ return String_convert::int_string (i, format);
+}
+
+string
+to_string (bool b)
+{
+ return String_convert::bool_string (b);
+}
+
+string
+to_string (long b)
+{
+ return String_convert::long_string (b);
+}
+
+string
+to_string (long unsigned b)
+{
+ return String_convert::unsigned_string (b);
+}
+
+string
+to_string (unsigned u)
+{
+ return String_convert::unsigned_string (u);
+}
+
+string
+to_string (char const *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ string str = String_convert::vform_string (format, args);
+ va_end (args);
+ return str;
+}
+
+string &
+replace_all (string &str, string find, string replace)
+{
+ ssize len = find.length ();
+ for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + len))
+ str = str.replace (i, len, replace);
+ return str;
+}
+
+string &
+replace_all (string &str, char find, char replace)
+{
+ for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + 1))
+ str[i] = replace;
+ return str;
+}
+
+char *
+string_copy (string s)
+{
+ ssize len = s.length ();
+ char *dest = new char[len + 1];
+ //s.copy (dest, len + 1);
+ memcpy (dest, s.c_str (), len + 1);
+ return dest;
+}
+int
+string_compare (string const &a, string const &b)
+{
+ return a.compare (b);
}
*/
static const int STRING_BUFFER_LEN = 1024;
-std::string
+string
String_convert::bool_string (bool b)
{
- return std::string (b ? "true" : "false");
+ return string (b ? "true" : "false");
}
-std::string
-String_convert::bin2hex (std::string bin_string)
+string
+String_convert::bin2hex (string bin_string)
{
- std::string str;
+ string str;
Byte const *byte = (Byte const*)bin_string.data ();
for (ssize i = 0; i < bin_string.length (); i++)
{
}
int
-String_convert::bin2int (std::string bin_string)
+String_convert::bin2int (string bin_string)
{
return bin2unsigned (bin_string);
}
unsigned
-String_convert::bin2unsigned (std::string bin_string)
+String_convert::bin2unsigned (string bin_string)
{
assert (bin_string.length () <= (int)sizeof (unsigned));
return result_u;
}
-// breendet imp from std::string
+// breendet imp from string
int
-String_convert::dec2int (std::string dec_string)
+String_convert::dec2int (string dec_string)
{
if (!dec_string.length ())
return 0;
return (int)l;
}
-std::string
+string
String_convert::i64_string (I64 i64, char const *fmt)
{
char buffer[STRING_BUFFER_LEN];
snprintf (buffer, STRING_BUFFER_LEN,
(fmt ? fmt : "%Ld"), i64); // assume radix 10
- return std::string (buffer);
+ return string (buffer);
}
-// breendet imp from std::string
+// breendet imp from string
double
-String_convert::dec2double (std::string dec_string)
+String_convert::dec2double (string dec_string)
{
if (!dec_string.length ())
return 0;
}
int
-String_convert::hex2bin (std::string hex_string, std::string &bin_string_r)
+String_convert::hex2bin (string hex_string, string &bin_string_r)
{
if (hex_string.length () % 2)
hex_string = "0" + hex_string;
return 0;
}
-std::string
-String_convert::hex2bin (std::string hex_string)
+string
+String_convert::hex2bin (string hex_string)
{
- std::string str;
+ string str;
// silly, asserts should alway be "on"!
// assert (!hex2bin (hex_string, str) );
int error_i = hex2bin (hex_string, str);
}
// stupido. Should use int_string ()
-std::string
+string
String_convert::int2dec (int i, int length_i, char ch)
{
char fill_char = ch;
fill_char = '0';
// ugh
- std::string dec_string = to_string (i);
+ string dec_string = to_string (i);
// ugh
return to_string (fill_char, length_i - dec_string.length ()) + dec_string;
}
// stupido. Should use int_string ()
-std::string
+string
String_convert::unsigned2hex (unsigned u, ssize length, char fill_char)
{
- std::string str;
+ string str;
if (!u)
str = "0";
return str;
}
-std::string
+string
String_convert::int2hex (int i, int length_i, char fill_char)
{
return unsigned2hex ((unsigned)i, length_i, fill_char);
@param
#fmt# is a printf style format, default assumes "%d" as format.
*/
-std::string
+string
String_convert::int_string (int i, char const *fmt)
{
char buffer[STRING_BUFFER_LEN];
snprintf (buffer, STRING_BUFFER_LEN,
(fmt ? fmt : "%d"), i); // assume radix 10
- return std::string (buffer);
+ return string (buffer);
}
-std::string
+string
String_convert::form_string (char const *format, ...)
{
va_list args;
char buffer[STRING_BUFFER_LEN];
vsnprintf (buffer, STRING_BUFFER_LEN, format, args);
va_end (args);
- return std::string (buffer);
+ return string (buffer);
}
-std::string
+string
String_convert::vform_string (char const *format, va_list args)
{
char buffer[STRING_BUFFER_LEN];
vsnprintf (buffer, STRING_BUFFER_LEN, format, args);
- return std::string (buffer);
+ return string (buffer);
}
/**
@param #fmt# is a printf style format, default assumes "%lf" as format
*/
-std::string
+string
String_convert::double_string (double f, char const *fmt)
{
char buf[STRING_BUFFER_LEN];
snprintf (buf, STRING_BUFFER_LEN, fmt ? fmt : "%f", f);
- return std::string (buf);
+ return string (buf);
}
/**
@param
#n# is a repetition count, default value is 1
*/
-std::string
+string
String_convert::char_string (char c, int n)
{
n = n >= 0 ? n : 0;
char *ch = new char[ n ];
memset (ch, c, n);
- std::string s (ch, n);
+ string s (ch, n);
delete[] ch;
return s;
}
-std::string
+string
String_convert::rational_string (Rational r)
{
return r.to_string ();
}
-std::string
+string
String_convert::pointer_string (void const *l)
{
char buffer[STRING_BUFFER_LEN];
snprintf (buffer, STRING_BUFFER_LEN, "%p", l); // assume radix 10
- return std::string (buffer);
+ return string (buffer);
}
/**
@param
#n# is the number of nonzero digits
*/
-std::string
+string
String_convert::precision_string (double x, int n)
{
- std::string format = "%." + to_string (max (0, n - 1)) + "e";
- std::string str = double_string (abs (x), format.c_str ());
+ string format = "%." + to_string (max (0, n - 1)) + "e";
+ string str = double_string (abs (x), format.c_str ());
int exp = dec2int (str.substr (str.length () - 3));
str = str.substr (0, str.length () - 4);
return (sign (x) > 0 ? str : "-" + str);
}
-std::vector<std::string>
-String_convert::split (std::string str, char c)
+vector<string>
+String_convert::split (string str, char c)
{
- std::vector<std::string> a;
+ vector<string> a;
ssize i = str.find (c);
while (i != NPOS)
{
- std::string s = str.substr (0, i);
+ string s = str.substr (0, i);
a.push_back (s);
while (str[++i] == c)
;
return a;
}
-std::string
+string
String_convert::long_string (long l)
{
char s[STRING_BUFFER_LEN];
return s;
}
-std::string
+string
String_convert::unsigned_string (unsigned u)
{
char s[STRING_BUFFER_LEN];
return s;
}
-std::string
-String_convert::pad_to (std::string s, int n)
+string
+String_convert::pad_to (string s, int n)
{
- return s + std::string (max (int(n - s.length ()), 0), ' ');
+ return s + string (max (int(n - s.length ()), 0), ' ');
}
-std::string
-String_convert::to_upper (std::string s)
+string
+String_convert::to_upper (string s)
{
return strnupr ((char *)s.c_str (), s.length ());
}
-std::string
-String_convert::to_lower (std::string s)
+string
+String_convert::to_lower (string s)
{
return strnlwr ((char *)s.c_str (), s.length ());
}
-std::string
-String_convert::reverse (std::string s)
+string
+String_convert::reverse (string s)
{
return (char*) memrev ((unsigned char *)s.data (), s.length ());
}
vector<char*> w;
binary_search_bounds (w, (char*)1, &default_compare, &i, &j);
- test_suite *test = BOOST_TEST_SUITE("std::Flower");
+ test_suite *test = BOOST_TEST_SUITE("Flower");
test->add (BOOST_TEST_CASE (vector_erase));
test->add (BOOST_TEST_CASE (vector_slice));
test->add (BOOST_TEST_CASE (vector_sorting));
/* Display user information that is not a full message. */
void
-progress_indication (std::string s)
+progress_indication (string s)
{
/* Test if all silly progress_indication ("\n") can be dropped now. */
if (s == "\n")
/* Display a single user message. Always starts on a new line. */
void
-message (std::string s)
+message (string s)
{
if (!progress_newline)
fputc ('\n', stderr);
/* Display a warning message. Always starts on a new line. */
void
-warning (std::string s)
+warning (string s)
{
message (_f ("warning: %s", s.c_str ()) + "\n");
}
void
-non_fatal_error (std::string s)
+non_fatal_error (string s)
{
message (_f ("error: %s", s.c_str ()) + "\n");
}
/* Display an error message. Always starts on a new line. */
void
-error (std::string s)
+error (string s)
{
non_fatal_error (s);
exit (1);
}
void
-programming_error (std::string s)
+programming_error (string s)
{
message (_f ("programming error: %s", s) + "\n");
message (_ ("continuing, cross fingers") + "\n");
to store all information before we can really create the
accidentals.
*/
- std::vector<Grob*> left_objects_;
- std::vector<Grob*> right_objects_;
+ vector<Grob*> left_objects_;
+ vector<Grob*> right_objects_;
Grob *accidental_placement_;
- std::vector<Accidental_entry> accidentals_;
- std::vector<Spanner*> ties_;
+ vector<Accidental_entry> accidentals_;
+ vector<Spanner*> ties_;
};
/*
&& note->is_mus_type ("note-event"))
{
/*
- std::string harmonics usually don't have accidentals.
+ string harmonics usually don't have accidentals.
*/
if (to_boolean (get_property ("harmonicAccidentals"))
|| !ly_is_equal (info.grob ()->get_property ("style"),
*/
void
Accidental_placement::split_accidentals (Grob *accs,
- Link_array__Grob_ *break_reminder,
- Link_array__Grob_ *real_acc)
+ vector<Grob*> *break_reminder,
+ vector<Grob*> *real_acc)
{
for (SCM acs = accs->get_object ("accidental-grobs"); scm_is_pair (acs);
acs = scm_cdr (acs))
Item *item_col,
Grob *left_object)
{
- Link_array__Grob_ br, ra;
- Link_array__Grob_ *which = 0;
+ vector<Grob*> br, ra;
+ vector<Grob*> *which = 0;
Accidental_placement::split_accidentals (me, &br, &ra);
concat (br, ra);
struct Accidental_placement_entry
{
- std::vector<Skyline_entry> left_skyline_;
- std::vector<Skyline_entry> right_skyline_;
+ vector<Skyline_entry> left_skyline_;
+ vector<Skyline_entry> right_skyline_;
Interval vertical_extent_;
- std::vector<Box> extents_;
- Link_array__Grob_ grobs_;
+ vector<Box> extents_;
+ vector<Grob*> grobs_;
Real offset_;
int notename_;
Accidental_placement_entry ()
placement
*/
void
-stagger_apes (Link_array__Accidental_placement_entry_ *apes)
+stagger_apes (vector<Accidental_placement_entry*> *apes)
{
- Link_array__Accidental_placement_entry_ asc = *apes;
+ vector<Accidental_placement_entry*> asc = *apes;
vector_sort (asc, &ape_compare);
TODO: there is a bug in this code. If two accs are on the same
Y-position, they share an Ape, and will be printed in overstrike.
*/
- Link_array__Accidental_placement_entry_ apes;
+ vector<Accidental_placement_entry*> apes;
for (SCM s = accs; scm_is_pair (s); s = scm_cdr (s))
{
Accidental_placement_entry *ape = new Accidental_placement_entry;
First we must extract *all* pointers. We can only determine
extents if we're sure that we've found the right common refpoint
*/
- Link_array__Grob_ note_cols, heads;
+ vector<Grob*> note_cols, heads;
for (vsize i = apes.size (); i--;)
{
Accidental_placement_entry *ape = apes[i];
{
Grob *a = apes[i]->grobs_[j];
- std::vector<Box> boxes = Accidental_interface::accurate_boxes (a, common);
+ vector<Box> boxes = Accidental_interface::accurate_boxes (a, common);
ape->extents_.insert (ape->extents_.end (), boxes.begin (), boxes.end ());
for (vsize j = boxes.size (); j--;)
Accidental_placement_entry *head_ape = new Accidental_placement_entry;
common[X_AXIS] = common_refpoint_of_array (heads, common[X_AXIS], X_AXIS);
- std::vector<Skyline_entry> head_skyline (empty_skyline (LEFT));
- std::vector<Box> head_extents;
+ vector<Skyline_entry> head_skyline (empty_skyline (LEFT));
+ vector<Box> head_extents;
for (vsize i = heads.size (); i--;)
{
Box b (heads[i]->extent (common[X_AXIS], X_AXIS),
Real padding = robust_scm2double (me->get_property ("padding"), 0.2);
- std::vector<Skyline_entry> left_skyline = head_ape->left_skyline_;
+ vector<Skyline_entry> left_skyline = head_ape->left_skyline_;
heighten_skyline (&left_skyline,
-robust_scm2double (me->get_property ("right-padding"), 0));
/*
apes[i]->offset_ = offset;
- std::vector<Skyline_entry> new_left_skyline = apes[i]->left_skyline_;
+ vector<Skyline_entry> new_left_skyline = apes[i]->left_skyline_;
heighten_skyline (&new_left_skyline, apes[i]->offset_);
merge_skyline (&new_left_skyline, left_skyline, LEFT);
left_skyline = new_left_skyline;
return SCM_UNSPECIFIED;
}
-std::vector<Box>
+vector<Box>
Accidental_interface::accurate_boxes (Grob *a, Grob **common)
{
Box b;
b[X_AXIS] = a->extent (a, X_AXIS);
b[Y_AXIS] = a->extent (a, Y_AXIS);
- std::vector<Box> boxes;
+ vector<Box> boxes;
bool parens = false;
if (to_boolean (a->get_property ("cautionary")))
/*
todo: this sort of stuff in Scheme. --hwn.
*/
-std::string
-Accidental_interface::get_fontcharname (std::string style, int alteration)
+string
+Accidental_interface::get_fontcharname (string style, int alteration)
{
if (alteration == DOUBLE_FLAT
|| alteration == DOUBLE_SHARP)
}
SCM scm_style = me->get_property ("style");
- std::string style;
+ string style;
if (scm_is_symbol (scm_style))
style = ly_symbol2string (scm_style);
else
scm_is_pair (s); s = scm_cdr (s))
{
int alteration = scm_to_int (scm_car (s));
- std::string font_char = get_fontcharname (style, alteration);
+ string font_char = get_fontcharname (style, alteration);
Stencil acc (fm->find_by_name ("accidentals." + font_char));
if (acc.is_empty ())
extract_grob_set (me, "elements", elem_source);
- Link_array__Grob_ elems (elem_source); // writable..
+ vector<Grob*> elems (elem_source); // writable..
Real where_f = 0;
Interval v;
v.set_empty ();
- std::vector<Real> translates;
+ vector<Real> translates;
for (vsize j = elems.size (); j--;)
{
Interval threshold = robust_scm2interval (me->get_property ("threshold"),
Interval (0, Interval::infinity ()));
- std::vector<Interval> dims;
- Link_array__Grob_ elems;
+ vector<Interval> dims;
+ vector<Grob*> elems;
extract_grob_set (me, "elements", all_grobs);
for (vsize i = 0; i < all_grobs.size (); i++)
: SCM_EOL,
extra_space);
- std::vector<Real> translates;
+ vector<Real> translates;
for (vsize j = 0; j < elems.size (); j++)
{
Real dy = -dims[j][-stacking_dir];
/*
also move the grobs that were empty, to maintain spatial order.
*/
- std::vector<Real> all_translates;
+ vector<Real> all_translates;
if (translates.size ())
{
Real w = translates[0];
static char const *default_font_str0_ = "cmr10";
-All_font_metrics::All_font_metrics (std::string path)
+All_font_metrics::All_font_metrics (string path)
{
tfm_dict_ = new Scheme_hash_table;
otf_dict_ = new Scheme_hash_table;
if (!pango_dict_->try_retrieve (key, &val))
{
if (be_verbose_global)
- progress_indication ("[" + std::string (pango_fn));
+ progress_indication ("[" + string (pango_fn));
Pango_font *pf = new Pango_font (pango_ft2_fontmap_,
description,
#endif
-std::string
-kpathsea_find_file (std::string name, std::string ext)
+string
+kpathsea_find_file (string name, string ext)
{
name += "." + ext;
- std::string path = global_path.find (name);
+ string path = global_path.find (name);
if (path.length () > 0)
return path;
}
Open_type_font *
-All_font_metrics::find_otf (std::string name)
+All_font_metrics::find_otf (string name)
{
SCM sname = ly_symbol2scm (name.c_str ());
SCM name_string = scm_makfrom0str (name.c_str ());
SCM val;
if (!otf_dict_->try_retrieve (sname, &val))
{
- std::string file_name;
+ string file_name;
if (file_name.empty ())
file_name = search_path_.find (name + ".otf");
}
Tex_font_metric *
-All_font_metrics::find_tfm (std::string name)
+All_font_metrics::find_tfm (string name)
{
SCM sname = ly_symbol2scm (name.c_str ());
SCM name_string = scm_makfrom0str (name.c_str ());
SCM val;
if (!tfm_dict_->try_retrieve (sname, &val))
{
- std::string file_name;
+ string file_name;
if (file_name.empty ())
{
/* FIXME: should add "cork-" prefix to lm* fonts. How to do
that, cleanly? */
- std::string p = kpathsea_find_file (name, "tfm");
+ string p = kpathsea_find_file (name, "tfm");
if (p.length ())
file_name = p;
}
}
Font_metric *
-All_font_metrics::find_font (std::string name)
+All_font_metrics::find_font (string name)
{
Font_metric *f = find_otf (name);
warning (_ ("loading default font"));
}
- std::string def_name = default_font_str0_;
+ string def_name = default_font_str0_;
if (!f)
f = find_tfm (def_name);
&& heads.size () > 1)
{
Grob *common
- = common_refpoint_of_array (Link_array__Grob_ (heads.begin (),
+ = common_refpoint_of_array (vector<Grob*> (heads.begin (),
heads.begin () + 2),
me, Y_AXIS);
origin_trans_ = 0;
}
-Link_array__Context_
+vector<Context*>
Audio_element_info::origin_contexts (Translator *end) const
{
Context *t = origin_trans_->context ();
- Link_array__Context_ r;
+ vector<Context*> r;
do
{
r.push_back (t);
#include "midi-item.hh"
#include "audio-column.hh"
-Audio_instrument::Audio_instrument (std::string instrument_string)
+Audio_instrument::Audio_instrument (string instrument_string)
{
str_ = instrument_string;
}
one_beat_ = one_beat;
}
-Audio_text::Audio_text (Audio_text::Type type, std::string text_string)
+Audio_text::Audio_text (Audio_text::Type type, string text_string)
{
text_string_ = text_string;
type_ = type;
*/
Moment shortest_mom_;
Spanner *finished_beam_;
- Link_array__Item_ *stems_;
+ vector<Item*> *stems_;
int process_acknowledged_count_;
Moment last_add_mom_;
return;
}
- stems_ = new Link_array__Item_;
+ stems_ = new vector<Item*>;
grouping_ = new Beaming_info_list;
beam_settings_ = updated_grob_properties (context (), ly_symbol2scm ("Beam"));
virtual void do_quit ();
virtual void construct_children ();
virtual void process (Moment);
- std::vector<Pitch> pending_pitch (Moment) const;
+ vector<Pitch> pending_pitch (Moment) const;
private:
SCM split_list_;
Direction where_dir_;
- void change_to (Music_iterator *, SCM, std::string);
+ void change_to (Music_iterator *, SCM, string);
Moment start_moment_;
Context_handle up_;
void
Auto_change_iterator::change_to (Music_iterator *it, SCM to_type_sym,
- std::string to_id)
+ string to_id)
{
Context *current = it->get_outlet ();
Context *last = 0;
if (current && current->id_string () == to_id)
{
- std::string msg;
+ string msg;
msg += _f ("can't change, already in translator: %s", to_id);
}
if (d && d != where_dir_)
{
where_dir_ = d;
- std::string to_id = (d >= 0) ? "up" : "down";
+ string to_id = (d >= 0) ? "up" : "down";
change_to (child_iter_,
ly_symbol2scm ("Staff"),
to_id);
SCM_ASSERT_TYPE (unsmob_grob (common), common, SCM_ARG2, __FUNCTION__, "grob");
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
- Link_array__Grob_ elts;
+ vector<Grob*> elts;
if (!ga)
{
for (SCM s = elements; scm_is_pair (s); s = scm_cdr (s))
}
Interval
-Axis_group_interface::relative_group_extent (Link_array__Grob_ const &elts,
+Axis_group_interface::relative_group_extent (vector<Grob*> const &elts,
Grob *common, Axis a)
{
Interval r;
}
void
-Axis_group_interface::get_children (Grob *me, Link_array__Grob_ *found)
+Axis_group_interface::get_children (Grob *me, vector<Grob*> *found)
{
found->push_back (me);
{
public:
TRANSLATOR_DECLARATIONS (Bar_engraver);
- void request_bar (std::string type_string);
+ void request_bar (string type_string);
protected:
virtual void finalize ();
if (scm_is_string (s) && scm_is_number (barsize))
{
- std::string str = ly_scm2string (s);
+ string str = ly_scm2string (s);
Real sz = robust_scm2double (barsize, 0);
if (sz <= 0)
return SCM_EOL;
}
Stencil
-Bar_line::compound_barline (Grob *me, std::string str, Real h,
+Bar_line::compound_barline (Grob *me, string str, Real h,
bool rounded)
{
Real kern = robust_scm2double (me->get_property ("kern"), 1);
#include "directional-element-interface.hh"
bool
-is_concave_single_notes (std::vector<int> const &positions, Direction beam_dir)
+is_concave_single_notes (vector<int> const &positions, Direction beam_dir)
{
Interval covering;
covering.add_point (positions[0]);
}
Real
-calc_positions_concaveness (std::vector<int> const &positions, Direction beam_dir)
+calc_positions_concaveness (vector<int> const &positions, Direction beam_dir)
{
Real dy = positions.back () - positions[0];
Real slope = dy / Real (positions.size () - 1);
{
Grob *me = unsmob_grob (smob);
- Link_array__Grob_ stems
+ vector<Grob*> stems
= extract_grob_array (me, "stems");
if (is_knee (me))
if (stems.size () <= 2)
return SCM_UNSPECIFIED;
- std::vector<int> close_positions;
- std::vector<int> far_positions;
+ vector<int> close_positions;
+ vector<int> far_positions;
for (vsize i = 0; i < stems.size (); i++)
{
/*
Music *m = info.ultimate_music_cause ();
if (!m->is_mus_type ("rhythmic-event"))
{
- std::string s = _ ("stem must have Rhythmic structure");
+ string s = _ ("stem must have Rhythmic structure");
if (info.music_cause ())
info.music_cause ()->origin ()->warning (s);
else
Real demerits;
#if DEBUG_QUANTING
- std::string score_card_;
+ string score_card_;
#endif
};
*/
int
-best_quant_score_idx (std::vector<Quant_score> const &qscores)
+best_quant_score_idx (vector<Quant_score> const &qscores)
{
Real best = 1e6;
int best_idx = -1;
Real quants [] = {straddle, sit, inter, hang };
int num_quants = int (sizeof (quants) / sizeof (Real));
- std::vector<Real> quantsl;
- std::vector<Real> quantsr;
+ vector<Real> quantsl;
+ vector<Real> quantsr;
/*
going to REGION_SIZE == 2, yields another 0.6 second with
Do stem computations. These depend on YL and YR linearly, so we can
precompute for every stem 2 factors.
*/
- Link_array__Grob_ stems
+ vector<Grob*> stems
= extract_grob_array (me, "stems");
- std::vector<Stem_info> stem_infos;
- std::vector<Real> base_lengths;
- std::vector<Real> stem_xposns;
+ vector<Stem_info> stem_infos;
+ vector<Real> base_lengths;
+ vector<Real> stem_xposns;
Drul_array<bool> dirs_found (0, 0);
Grob *common[2];
quantsr.push_back (i + quants[j] + int (yr));
}
- std::vector<Quant_score> qscores;
+ vector<Quant_score> qscores;
for (vsize l = 0; l < quantsl.size (); l++)
for (vsize r = 0; r < quantsr.size (); r++)
}
Real
-Beam::score_stem_lengths (Link_array__Grob_ const &stems,
- std::vector<Stem_info> const &stem_infos,
- std::vector<Real> const &base_stem_ys,
- std::vector<Real> const &stem_xs,
+Beam::score_stem_lengths (vector<Grob*> const &stems,
+ vector<Stem_info> const &stem_infos,
+ vector<Real> const &base_stem_ys,
+ vector<Real> const &stem_xs,
Real xl, Real xr,
bool knee,
Real yl, Real yr,
SCM left = (i > 0) ? scm_cdr (last_beaming) : SCM_EOL;
SCM right = stem ? scm_car (this_beaming) : SCM_EOL;
- std::vector<int> full_beams;
- std::vector<int> lfliebertjes;
- std::vector<int> rfliebertjes;
+ vector<int> full_beams;
+ vector<int> lfliebertjes;
+ vector<int> rfliebertjes;
for (SCM s = left;
scm_is_pair (s); s = scm_cdr (s))
should be switchable for those who want to twiddle with the
parameters.
*/
- std::string str;
+ string str;
SCM properties = Font_interface::text_font_alist_chain (me);
Direction stem_dir = stems.size () ? to_dir (stems[0]->get_property ("direction")) : UP;
Grob *common = common_refpoint_of_array (stems, me, Y_AXIS);
Real staff_space = Staff_symbol_referencer::staff_space (me);
- std::vector<Interval> head_extents_array;
+ vector<Interval> head_extents_array;
for (vsize i = 0; i < stems.size (); i++)
{
Grob *stem = stems[i];
if (count < 1)
return ly_interval2scm (pos);
- std::vector<Real> x_posns;
+ vector<Real> x_posns;
extract_grob_set (me, "stems", stems);
Grob *commonx = common_refpoint_of_array (stems, me, X_AXIS);
Grob *commony = common_refpoint_of_array (stems, me, Y_AXIS);
}
else
{
- std::vector<Offset> ideals;
+ vector<Offset> ideals;
for (vsize i = 0; i < stems.size (); i++)
{
Grob *s = stems[i];
/*
Code dup.
*/
- std::vector<Real> x_posns;
+ vector<Real> x_posns;
extract_grob_set (me, "stems", stems);
Grob *commonx = common_refpoint_of_array (stems, me, X_AXIS);
Grob *commony = common_refpoint_of_array (stems, me, Y_AXIS);
Drul_array<Beaming_info_list> splits;
int m = best_splitpoint_index (beat_length, subdivide);
bool split = subdivide && (m & at_beat); m = m & ~at_beat;
- splits[LEFT].infos_ = std::vector<Beaming_info> (infos_.begin (),
+ splits[LEFT].infos_ = vector<Beaming_info> (infos_.begin (),
infos_.begin () + m);
- splits[RIGHT].infos_ = std::vector<Beaming_info> (infos_.begin () + m,
+ splits[RIGHT].infos_ = vector<Beaming_info> (infos_.begin () + m,
infos_.end ());
Direction d = LEFT;
}
void
-scale (std::vector<Offset> *array, Real x, Real y)
+scale (vector<Offset> *array, Real x, Real y)
{
for (vsize i = 0; i < array->size (); i++)
{
}
void
-rotate (std::vector<Offset> *array, Real phi)
+rotate (vector<Offset> *array, Real phi)
{
Offset rot (complex_exp (Offset (0, phi)));
for (vsize i = 0; i < array->size (); i++)
}
void
-translate (std::vector<Offset> *array, Offset o)
+translate (vector<Offset> *array, Offset o)
{
for (vsize i = 0; i < array->size (); i++)
(*array)[i] += o;
Bezier::get_other_coordinate (Axis a, Real x) const
{
Axis other = Axis ((a +1) % NO_AXES);
- std::vector<Real> ts = solve_point (a, x);
+ vector<Real> ts = solve_point (a, x);
if (ts.size () == 0)
{
/**
Remove all numbers outside [0, 1] from SOL
*/
-std::vector<Real>
-filter_solutions (std::vector<Real> sol)
+vector<Real>
+filter_solutions (vector<Real> sol)
{
for (vsize i = sol.size (); i--;)
if (sol[i] < 0 || sol[i] > 1)
/**
find t such that derivative is proportional to DERIV
*/
-std::vector<Real>
+vector<Real>
Bezier::solve_derivative (Offset deriv) const
{
Polynomial xp = polynomial (X_AXIS);
/*
Find t such that curve_point (t)[AX] == COORDINATE
*/
-std::vector<Real>
+vector<Real>
Bezier::solve_point (Axis ax, Real coordinate) const
{
Polynomial p (polynomial (ax));
p.coefs_[0] -= coordinate;
- std::vector<Real> sol (p.solve ());
+ vector<Real> sol (p.solve ());
return filter_solutions (sol);
}
Offset d;
d[Axis (o)] = 1.0;
Interval iv;
- std::vector<Real> sols (solve_derivative (d));
+ vector<Real> sols (solve_derivative (d));
sols.push_back (1.0);
sols.push_back (0.0);
for (vsize i = sols.size (); i--;)
#include "binary-source-file.hh"
#include "string-convert.hh"
-Binary_source_file::Binary_source_file (std::string &file_name_string)
+Binary_source_file::Binary_source_file (string &file_name_string)
: Source_file (file_name_string)
{
}
{
}
-std::string
+string
Binary_source_file::quote_input (char const *pos_str0) const
{
assert (this);
char const *begin_str0 = max (pos_str0 - 8, c_str ());
char const *end_str0 = min (pos_str0 + 7, c_str () + length ());
- std::string pre_string (begin_str0, pos_str0 - begin_str0);
+ string pre_string (begin_str0, pos_str0 - begin_str0);
pre_string = String_convert::bin2hex (pre_string);
for (ssize i = 2; i < pre_string.length (); i += 3)
pre_string = pre_string.substr (0, i)
+ " " + pre_string.substr (i, NPOS);
- std::string post_string (pos_str0, end_str0 - pos_str0);
+ string post_string (pos_str0, end_str0 - pos_str0);
post_string = String_convert::bin2hex (post_string);
for (ssize i = 2; i < post_string.length (); i += 3)
post_string = post_string.substr (0, i)
+ " " + post_string.substr (i, NPOS);
- std::string str = pre_string
+ string str = pre_string
+ to_string ('\n')
+ to_string (' ', pre_string.length () + 1)
+ post_string;
#include "cpu-timer.hh"
#include "simple-spacer.hh"
-std::vector<int>
+vector<int>
Break_algorithm::find_break_indices () const
{
- Link_array__Grob_ all = pscore_->root_system ()->columns ();
- std::vector<int> retval;
+ vector<Grob*> all = pscore_->root_system ()->columns ();
+ vector<int> retval;
for (vsize i = 0; i < all.size (); i++)
if (Item::is_breakable (all[i]))
return retval;
}
-Link_array__Grob_
+vector<Grob*>
Break_algorithm::find_breaks () const
{
- Link_array__Grob_ all = pscore_->root_system ()->columns ();
- Link_array__Grob_ retval;
+ vector<Grob*> all = pscore_->root_system ()->columns ();
+ vector<Grob*> retval;
for (vsize i = 0; i < all.size (); i++)
if (Item::is_breakable (all[i]))
}
Simple_spacer_wrapper *
-Break_algorithm::generate_spacing_problem (Link_array__Grob_ const &curline,
+Break_algorithm::generate_spacing_problem (vector<Grob*> const &curline,
Interval line) const
{
Simple_spacer_wrapper *spw = new Simple_spacer_wrapper;
linewidth_ = s->layout ()->get_dimension (ly_symbol2scm ("line-width"));
}
-std::vector<Column_x_positions>
+vector<Column_x_positions>
Break_algorithm::solve () const
{
- std::vector<Column_x_positions> h= do_solve ();
+ vector<Column_x_positions> h= do_solve ();
return h;
}
So we return the correct order as an array.
*/
-Link_array__Grob_
+vector<Grob*>
Break_align_interface::ordered_elements (Grob *grob)
{
Item *me = dynamic_cast<Item *> (grob);
|| scm_c_vector_length (order_vec) < 3)
return elts;
- Link_array__Grob_ writable_elts (elts);
+ vector<Grob*> writable_elts (elts);
SCM order = scm_vector_ref (order_vec,
scm_from_int (me->break_status_dir () + 1));
/*
Copy in order specified in BREAK-ALIGN-ORDER.
*/
- Link_array__Grob_ new_elts;
+ vector<Grob*> new_elts;
for (; scm_is_pair (order); order = scm_cdr (order))
{
SCM sym = scm_car (order);
Grob *grob = unsmob_grob (smob);
Item *me = dynamic_cast<Item *> (grob);
- Link_array__Grob_ elems = ordered_elements (me);
- std::vector<Interval> extents;
+ vector<Grob*> elems = ordered_elements (me);
+ vector<Interval> extents;
int last_nonempty = -1;
for (vsize i = 0; i < elems.size (); i++)
while (idx < extents.size () && extents[idx].is_empty ())
idx++;
- std::vector<Real> offsets;
+ vector<Real> offsets;
offsets.resize (elems.size ());
for (vsize i = 0; i < offsets.size ();i++)
offsets[i] = 0.0;
bool entry_found = scm_is_pair (entry);
if (!entry_found)
{
- std::string sym_string;
+ string sym_string;
if (scm_is_symbol (rsym))
sym_string = ly_symbol2string (rsym);
- std::string orig_string;
+ string orig_string;
if (unsmob_grob (l->get_property ("cause")))
orig_string = unsmob_grob (l->get_property ("cause"))->name ();
/*
Perform substitution on GROB_LIST using a constant amount of stack.
*/
-Link_array__Grob_ temporary_substition_array;
+vector<Grob*> temporary_substition_array;
void
substitute_grob_array (Grob_array *grob_arr, Grob_array *new_arr)
{
- Link_array__Grob_ &old_grobs (grob_arr->array_reference ());
- Link_array__Grob_ *new_grobs (new_arr == grob_arr
+ vector<Grob*> &old_grobs (grob_arr->array_reference ());
+ vector<Grob*> *new_grobs (new_arr == grob_arr
? & temporary_substition_array
: &new_arr->array_reference ());
qsort (vec, item_index,
sizeof (Substitution_entry), &Substitution_entry::item_compare);
- std::vector<Slice> item_indices;
- std::vector<Slice> spanner_indices;
+ vector<Slice> item_indices;
+ vector<Slice> spanner_indices;
for (int i = 0; i <= system_range.length (); i++)
{
item_indices.push_back (Slice (len, 0));
spanner_indices.push_back (Slice (len, 0));
}
- std::vector<Slice> *arrs[]
+ vector<Slice> *arrs[]
= {
&item_indices, &spanner_indices
};
#include "warn.hh"
void
-Change_iterator::error (std::string reason)
+Change_iterator::error (string reason)
{
- std::string to_type = ly_symbol2string (get_music ()->get_property ("change-to-type"));
- std::string to_id = ly_scm2string (get_music ()->get_property ("change-to-id"));
+ string to_type = ly_symbol2string (get_music ()->get_property ("change-to-type"));
+ string to_id = ly_scm2string (get_music ()->get_property ("change-to-id"));
- std::string warn1 = _f ("can't change `%s' to `%s'", to_type, to_id)
+ string warn1 = _f ("can't change `%s' to `%s'", to_type, to_id)
+ ": " + reason;
/*
GUHG!
*/
- std::string warn2= "Change_iterator::process (): "
+ string warn2= "Change_iterator::process (): "
+ get_outlet ()->context_name () + " = `"
+ get_outlet ()->id_string () + "': ";
warning (warn2);
Context *last = 0;
SCM to_type = get_music ()->get_property ("change-to-type");
- std::string to_id = ly_scm2string (get_music ()->get_property ("change-to-id"));
+ string to_id = ly_scm2string (get_music ()->get_property ("change-to-id"));
/* find the type of translator that we're changing.
if (current && current->id_string () == to_id)
{
- std::string msg;
+ string msg;
msg += _f ("can't change, already in translator: %s", to_id);
}
void add_note (Music *);
Item *chord_name_;
- Link_array__Music_ notes_;
+ vector<Music*> notes_;
SCM last_chord_;
};
Beam::add_stem (beam_, s);
else
{
- std::string s = _ ("stem must have Rhythmic structure");
+ string s = _ ("stem must have Rhythmic structure");
if (info.music_cause ())
info.music_cause ()->origin ()->warning (s);
else
if (scm_is_string (glyph))
{
- std::string str = ly_scm2string (glyph);
+ string str = ly_scm2string (glyph);
if (to_boolean (s->get_property ("non-default"))
&& s->break_status_dir () != RIGHT
if (!scm_is_string (glyph_scm))
return SCM_EOL;
- std::string glyph = std::string (ly_scm2string (glyph_scm));
+ string glyph = string (ly_scm2string (glyph_scm));
Font_metric *fm = Font_interface::get_default_font (me);
Stencil out = fm->find_by_name (glyph);
if (out.is_empty ())
void stop_translation_timestep ();
virtual void finalize ();
private:
- Link_array__Music_ cluster_notes_;
+ vector<Music*> cluster_notes_;
Item *beacon_;
void typeset_grobs ();
TODO: Add support for cubic spline segments.
*/
Stencil
-brew_cluster_piece (Grob *me, std::vector<Offset> bottom_points, std::vector<Offset> top_points)
+brew_cluster_piece (Grob *me, vector<Offset> bottom_points, vector<Offset> top_points)
{
Real blotdiameter = Staff_symbol_referencer::staff_space (me) / 2;
Offset hvpadding = 0.5 * hpadding + vpadding;
SCM shape_scm = me->get_property ("style");
- std::string shape;
+ string shape;
if (scm_is_symbol (shape_scm))
shape = ly_symbol2string (shape_scm);
}
Stencil out;
- std::vector<Offset> points;
+ vector<Offset> points;
points.clear ();
int size = bottom_points.size ();
if (shape == "leftsided-stairs")
Grob *commonx = left_bound->common_refpoint (right_bound, X_AXIS);
- Link_array__Grob_ const &cols = extract_grob_array (me, "columns");
+ vector<Grob*> const &cols = extract_grob_array (me, "columns");
if (cols.empty ())
{
me->warning (_ ("junking empty cluster"));
commonx = common_refpoint_of_array (cols, commonx, X_AXIS);
Grob *commony = common_refpoint_of_array (cols, me, Y_AXIS);
- std::vector<Offset> bottom_points;
- std::vector<Offset> top_points;
+ vector<Offset> bottom_points;
+ vector<Offset> top_points;
Real left_coord = left_bound->relative_coordinate (commonx, X_AXIS);
if (spanner->get_break_index () < orig->broken_intos_.size () - 1)
{
Spanner *next = orig->broken_intos_[spanner->get_break_index () + 1];
- Link_array__Grob_ const &next_cols = extract_grob_array (next, "columns");
+ vector<Grob*> const &next_cols = extract_grob_array (next, "columns");
if (next_cols.size () > 0)
{
Grob *next_commony = common_refpoint_of_array (next_cols, next, Y_AXIS);
* - collapse superflous space after each ligature (TODO).
*
* Concrete subclasses must implement function build_ligature (Spanner
- * *, std::vector<Grob_info>). This function is responsible for actually
+ * *, vector<Grob_info>). This function is responsible for actually
* building the ligature by transforming the array of noteheads.
*
* Currently, there are two subclasses: Gregorian_ligature_engraver
return;
}
- std::string name = parent->name ();
+ string name = parent->name ();
if (name != "PaperColumn")
{
// Change column not only for targeted item (NoteColumn), but
* occurs within the broken ligatures any more.
*/
void
-Coherent_ligature_engraver::collect_accidentals (Spanner *, std::vector<Grob_info>)
+Coherent_ligature_engraver::collect_accidentals (Spanner *, vector<Grob_info>)
{
/* TODO */
}
void
-compute_delta_pitches (std::vector<Grob_info> primitives)
+compute_delta_pitches (vector<Grob_info> primitives)
{
int prev_pitch = 0;
int delta_pitch = 0;
void
Coherent_ligature_engraver::typeset_ligature (Spanner *ligature,
- std::vector<Grob_info> primitives)
+ vector<Grob_info> primitives)
{
// compute some commonly needed context info stored as grob
// properties
class Collision_engraver : public Engraver
{
Item *col_;
- Link_array__Grob_ note_columns_;
+ vector<Grob*> note_columns_;
protected:
DECLARE_ACKNOWLEDGER (note_column);
class Completion_heads_engraver : public Engraver
{
- Link_array__Item_ notes_;
- Link_array__Item_ prev_notes_;
- Link_array__Grob_ ties_;
+ vector<Item*> notes_;
+ vector<Item*> prev_notes_;
+ vector<Grob*> ties_;
- Link_array__Item_ dots_;
- Link_array__Music_ note_events_;
- Link_array__Music_ scratch_note_events_;
+ vector<Item*> dots_;
+ vector<Music*> note_events_;
+ vector<Music*> scratch_note_events_;
Moment note_end_mom_;
bool is_first_;
return name;
}
-Link_array__Context_def_
+vector<Context_def*>
Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const
{
assert (scm_is_symbol (type_sym));
SCM accepted = get_accepted (SCM_EOL);
- Link_array__Context_def_ accepteds;
+ vector<Context_def*> accepteds;
for (SCM s = accepted; scm_is_pair (s); s = scm_cdr (s))
if (Context_def *t = unsmob_context_def (find_context_def (odef,
scm_car (s))))
accepteds.push_back (t);
- Link_array__Context_def_ best_result;
+ vector<Context_def*> best_result;
for (vsize i = 0; i < accepteds.size (); i++)
{
/* do not check aliases, because \context Staff should not
{
Context_def *g = accepteds[i];
- Link_array__Context_def_ result
+ vector<Context_def*> result
= g->path_to_acceptable_context (type_sym, odef);
if (result.size () && result.size () < best_depth)
{
{
SCM ct = get_music ()->get_property ("context-type");
- std::string c_id;
+ string c_id;
SCM ci = get_music ()->get_property ("context-id");
if (scm_is_string (ci))
c_id = ly_scm2string (ci);
/*
TODO: use accepts_list_.
*/
- Link_array__Context_def_ path
+ vector<Context_def*> path
= unsmob_context_def (definition_)->path_to_acceptable_context (n, get_output_def ());
if (path.size ())
}
Context *
-Context::find_create_context (SCM n, std::string id, SCM operations)
+Context::find_create_context (SCM n, string id, SCM operations)
{
/*
Don't create multiple score contexts.
/*
TODO: use accepts_list_.
*/
- Link_array__Context_def_ path
+ vector<Context_def*> path
= unsmob_context_def (definition_)->path_to_acceptable_context (n, get_output_def ());
if (path.size ())
{
SCM ops = (i == path.size () -1) ? operations : SCM_EOL;
- std::string this_id = "";
+ string this_id = "";
if (i == path.size () -1)
this_id = id;
Context *
Context::create_context (Context_def *cdef,
- std::string id,
+ string id,
SCM ops)
{
- std::string type = ly_symbol2string (cdef->get_context_name ());
+ string type = ly_symbol2string (cdef->get_context_name ());
Object_key const *key = get_context_key (type, id);
Context *new_context
= cdef->instantiate (ops, key);
}
Object_key const *
-Context::get_context_key (std::string type, std::string id)
+Context::get_context_key (string type, string id)
{
if (!use_object_keys)
return 0;
- std::string now_key = type + "@" + id;
+ string now_key = type + "@" + id;
int disambiguation_count = 0;
if (context_counts_.find (now_key) != context_counts_.end ())
}
Object_key const *
-Context::get_grob_key (std::string name)
+Context::get_grob_key (string name)
{
if (!use_object_keys)
return 0;
unique identifier for each (book,score) tuple.
*/
Object_key const *
-Context::create_grob_key (std::string name)
+Context::create_grob_key (string name)
{
int disambiguation_count = 0;
if (grob_counts_.find (name) != grob_counts_.end ())
SCM nm = default_child_context_name ();
SCM st = find_context_def (get_output_def (), nm);
- std::string name = ly_symbol2string (nm);
+ string name = ly_symbol2string (nm);
Context_def *t = unsmob_context_def (st);
if (!t)
{
*/
Context *
find_context_below (Context *where,
- SCM type, std::string id)
+ SCM type, string id)
{
if (where->is_alias (type))
{
return td->get_context_name ();
}
-std::string
+string
Context::context_name () const
{
return ly_symbol2string (context_name_symbol ());
private:
Item *create_custos ();
bool custos_permitted_;
- Link_array__Grob_ custodes_;
- std::vector<Pitch> pitches_;
+ vector<Grob*> custodes_;
+ vector<Pitch> pitches_;
};
Custos_engraver::Custos_engraver ()
Item *me = (Item *)unsmob_grob (smob);
SCM scm_style = me->get_property ("style");
- std::string style;
+ string style;
if (scm_is_symbol (scm_style))
style = ly_symbol2string (scm_style);
else
int pos = Staff_symbol_referencer::get_rounded_position (me);
int sz = Staff_symbol_referencer::line_count (me) - 1;
- std::string font_char = "custodes." + style + ".";
+ string font_char = "custodes." + style + ".";
if (pos < neutral_pos)
font_char += "u";
else if (pos > neutral_pos)
{
Grob *dotcol_;
Grob *stem_;
- Link_array__Item_ heads_;
+ vector<Item*> heads_;
public:
TRANSLATOR_DECLARATIONS (Dot_column_engraver);
Dot_column::calc_positioning_done (SCM smob)
{
Grob *me = unsmob_grob (smob);
- Link_array__Grob_ dots
+ vector<Grob*> dots
= extract_grob_array (me, "dots");
{ /*
if (scm_is_number (c))
{
- Stencil d = Font_interface::get_default_font (sc)->find_by_name (std::string ("dots.dot"));
+ Stencil d = Font_interface::get_default_font (sc)->find_by_name (string ("dots.dot"));
Real dw = d.extent (X_AXIS).length ();
/*
class Drum_notes_engraver : public Engraver
{
- Link_array__Item_ notes_;
- Link_array__Item_ dots_;
- Link_array__Item_ scripts_;
- Link_array__Music_ events_;
+ vector<Item*> notes_;
+ vector<Item*> dots_;
+ vector<Item*> scripts_;
+ vector<Music*> events_;
public:
TRANSLATOR_DECLARATIONS (Drum_notes_engraver);
void process_music ();
private:
- Link_array__Music_ note_evs_;
- Link_array__Audio_note_ notes_;
+ vector<Music*> note_evs_;
+ vector<Audio_note*> notes_;
};
Drum_note_performer::Drum_note_performer ()
return mom * factor_;
}
-std::string
+string
Duration::to_string () const
{
- std::string s;
+ string s;
if (durlog_ < 0)
- s = "log = " + std::to_string (durlog_);
+ s = "log = " + ::to_string (durlog_);
else
- s = std::to_string (1 << durlog_);
+ s = ::to_string (1 << durlog_);
- s += std::to_string ('.', dots_);
+ s += ::to_string ('.', dots_);
if (factor_ != Moment (Rational (1, 1)))
s += "*" + factor_.to_string ();
return s;
Drul_array<Music *> accepted_spanevents_drul_;
- Link_array__Note_column_ pending_columns_;
- Link_array__Grob_ pending_elements_;
+ vector<Note_column*> pending_columns_;
+ vector<Grob*> pending_elements_;
void typeset_all ();
{
if (current_cresc_ev_)
{
- std::string msg = _ ("already have a decrescendo");
+ string msg = _ ("already have a decrescendo");
if (current_cresc_ev_->is_mus_type ("decrescendo-event"))
msg = _ ("already have a crescendo");
TODO: Use symbols.
*/
- std::string start_type
+ string start_type
= ly_symbol2string (current_cresc_ev_->get_property ("name"));
/*
void add_brackets ();
void create_grobs ();
- void center_continuations (Link_array__Spanner_ const &consecutive_lines);
+ void center_continuations (vector<Spanner*> const &consecutive_lines);
void center_repeated_continuations ();
protected:
- std::vector<Figure_group> groups_;
+ vector<Figure_group> groups_;
Spanner *alignment_;
- Link_array__Music_ new_musics_;
+ vector<Music*> new_musics_;
bool continuation_;
bool new_music_found_;
}
void
-Figured_bass_engraver::center_continuations (Link_array__Spanner_ const &consecutive_lines)
+Figured_bass_engraver::center_continuations (vector<Spanner*> const &consecutive_lines)
{
if (consecutive_lines.size () == 2)
{
- Link_array__Grob_ left_figs;
+ vector<Grob*> left_figs;
for (vsize j = consecutive_lines.size(); j--;)
left_figs.push_back (consecutive_lines[j]->get_bound (LEFT));
void
Figured_bass_engraver::center_repeated_continuations ()
{
- Link_array__Spanner_ consecutive_lines;
+ vector<Spanner*> consecutive_lines;
for (vsize i = 0; i <= groups_.size(); i++)
{
if (i < groups_.size ()
void
Figured_bass_engraver::add_brackets ()
{
- Link_array__Grob_ encompass;
+ vector<Grob*> encompass;
bool inside = false;
for (vsize i = 0; i < groups_.size (); i ++)
{
if (use_extenders)
{
- std::vector<int> junk_continuations;
+ vector<int> junk_continuations;
for (vsize i = 0; i < groups_.size(); i++)
{
Figure_group &group = groups_[i];
/*
Ugh, repeated code.
*/
- Link_array__Spanner_ consecutive;
+ vector<Spanner*> consecutive;
if (to_boolean (get_property ("figuredBassCenterContinuations")))
{
for (vsize i = 0; i <= junk_continuations.size (); i++)
#include "file-name-map.hh"
#include "lily-guile.hh"
-map<std::string, std::string> file_name_map_global;
+map<string, string> file_name_map_global;
-std::string
-map_file_name (std::string s)
+string
+map_file_name (string s)
{
if (file_name_map_global.find (s) != file_name_map_global.end ())
s = file_name_map_global[s];
class Fingering_engraver : public Engraver
{
- Link_array__Music_ events_;
- Link_array__Item_ fingerings_;
+ vector<Music*> events_;
+ vector<Item*> fingerings_;
public:
TRANSLATOR_DECLARATIONS (Fingering_engraver);
if (!is_file ((char*)cache_file))
message (_f ("Rebuilding FontConfig cache %s. this may take a while...", cache_file));
- std::vector<std::string> dirs;
+ vector<string> dirs;
dirs.push_back (prefix_directory + "/fonts/otf/");
dirs.push_back (prefix_directory + "/fonts/type1/");
for (vsize i = 0; i < dirs.size (); i++)
{
- std::string dir = dirs[i];
+ string dir = dirs[i];
if (!FcConfigAppFontAddDir (font_config_global, (FcChar8 *)dir.c_str ()))
error (_f ("adding font directory: %s", dir.c_str ()));
else if (be_verbose_global)
}
Stencil
-Font_metric::find_by_name (std::string s) const
+Font_metric::find_by_name (string s) const
{
replace_all (s, '-', 'M');
int idx = name_to_index (s);
}
vsize
-Font_metric::name_to_index (std::string) const
+Font_metric::name_to_index (string) const
{
return VPOS;
}
return scm_car (description_);
}
-std::string
+string
Font_metric::font_name () const
{
- std::string s ("unknown");
+ string s ("unknown");
return s;
}
}
Offset
-Font_metric::attachment_point (std::string) const
+Font_metric::attachment_point (string) const
{
return Offset (0, 0);
}
}
Stencil
-Font_metric::text_stencil (std::string str) const
+Font_metric::text_stencil (string str) const
{
SCM lst = scm_list_3 (ly_symbol2scm ("text"),
this->self_scm (),
}
Box
-Font_metric::text_dimension (std::string) const
+Font_metric::text_dimension (string) const
{
return Box (Interval (0, 0), Interval (0, 0));
}
if (!doc_hash_table)
doc_hash_table = scm_permanent_object (scm_c_make_hash_table (59));
- std::string s = std::string (" - ") + "LilyPond procedure: " + fname + " " + varlist
+ string s = string (" - ") + "LilyPond procedure: " + fname + " " + varlist
+ "\n" + doc;
scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"),
{
SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string");
- std::string nm = ly_scm2string (name);
- std::string file_name = global_path.find (nm);
+ string nm = ly_scm2string (name);
+ string file_name = global_path.find (nm);
if (file_name.empty ())
return SCM_BOOL_F;
sz = scm_to_int (size);
}
- std::string contents = gulp_file_to_string (ly_scm2string (name), true, sz);
+ string contents = gulp_file_to_string (ly_scm2string (name), true, sz);
return scm_from_locale_stringn (contents.c_str (), contents.length ());
}
"Formats passed to --format as a list of strings, "
"used for the output.")
{
- std::vector<std::string> output_formats = split_string (output_format_global, ',');
+ vector<string> output_formats = split_string (output_format_global, ',');
SCM lst = SCM_EOL;
int output_formats_count = output_formats.size ();
{
if (line_)
{
- std::string msg = _ ("unterminated glissando");
+ string msg = _ ("unterminated glissando");
if (event_)
event_->origin ()->warning (msg);
#include "std-vector.hh"
-static std::vector<Global_ctor> *ctor_global_statics_;
+static vector<Global_ctor> *ctor_global_statics_;
void
add_constructor (Global_ctor c)
{
if (!ctor_global_statics_)
- ctor_global_statics_ = new std::vector<Global_ctor>;
+ ctor_global_statics_ = new vector<Global_ctor>;
ctor_global_statics_->push_back (c);
}
};
void
-print_break_nodes (std::vector<Break_node> const &arr)
+print_break_nodes (vector<Break_node> const &arr)
{
for (vsize i = 0; i < arr.size (); i++)
{
TODO: should rewrite. See the function in scm/page-layout.scm for
inspiration.
*/
-std::vector<Column_x_positions>
+vector<Column_x_positions>
Gourlay_breaking::do_solve () const
{
- std::vector<Break_node> optimal_paths;
- Link_array__Grob_ all
+ vector<Break_node> optimal_paths;
+ vector<Grob*> all
= pscore_->root_system ()->columns ();
- std::vector<int> breaks = find_break_indices ();
+ vector<int> breaks = find_break_indices ();
Break_node first_node;
optimal_paths.push_back (first_node);
for (vsize start_idx = break_idx; start_idx--;)
{
- Link_array__Grob_ line (all.begin () + breaks[start_idx],
+ vector<Grob*> line (all.begin () + breaks[start_idx],
all.begin () + breaks[break_idx] + 1);
line[0] = dynamic_cast<Item *> (line[0])->find_prebroken_piece (RIGHT);
optimal_paths.push_back (bnod);
if (! (break_idx % HAPPY_DOTS))
- progress_indication (std::string ("[") + to_string (break_idx) + "]");
+ progress_indication (string ("[") + to_string (break_idx) + "]");
}
/* do the last one */
if (breaks.size () % HAPPY_DOTS)
- progress_indication (std::string ("[") + to_string (breaks.size ()) + "]");
+ progress_indication (string ("[") + to_string (breaks.size ()) + "]");
progress_indication ("\n");
- std::vector<int> final_breaks;
- std::vector<Column_x_positions> lines;
+ vector<int> final_breaks;
+ vector<Column_x_positions> lines;
/* skip 0-th element, since it is a "dummy" elt*/
for (vsize i = optimal_paths.size () - 1; i > 0;)
fix_prefix ("pes_or_flexa", LINEA, current_set, min_set, max_set, primitive);
}
-void check_and_fix_all_prefixes (std::vector<Grob_info> primitives)
+void check_and_fix_all_prefixes (vector<Grob_info> primitives)
{
/* Check for illegal head modifier combinations */
for (vsize i = 0; i < primitives.size (); i++)
* Marks those heads that participate in a pes or flexa.
*/
void
-provide_context_info (std::vector<Grob_info> primitives)
+provide_context_info (vector<Grob_info> primitives)
{
Grob *prev_primitive = 0;
int prev_prefix_set = 0;
void
Gregorian_ligature_engraver::build_ligature (Spanner *ligature,
- std::vector<Grob_info> primitives)
+ vector<Grob_info> primitives)
{
// apply style-independent checking and transformation
check_and_fix_all_prefixes (primitives);
#include "grob.hh"
-void check_prefix (std::string name, int mask, int prefix_set, std::string *str)
+void check_prefix (string name, int mask, int prefix_set, string *str)
{
if (prefix_set & mask)
{
}
}
-std::string
+string
Gregorian_ligature::prefixes_to_str (Grob *primitive)
{
- std::string str;
+ string str;
int prefix_set
= scm_to_int (primitive->get_property ("prefix-set"));
check_prefix ("virga", VIRGA, prefix_set, &str);
class Grid_line_span_engraver : public Engraver
{
Item *spanline_;
- Link_array__Item_ lines_;
+ vector<Item*> lines_;
public:
TRANSLATOR_DECLARATIONS (Grid_line_span_engraver);
ordered_ = false;
}
-Link_array__Grob_ &
+vector<Grob*> &
Grob_array::array_reference ()
{
return grobs_;
}
-Link_array__Grob_ const &
+vector<Grob*> const &
Grob_array::array () const
{
return grobs_;
}
void
-Grob_array::set_array (Link_array__Grob_ const &src)
+Grob_array::set_array (vector<Grob*> const &src)
{
grobs_ = src;
}
return unsmob_music (cause);
}
-Link_array__Context_
+vector<Context*>
Grob_info::origin_contexts (Translator *end) const
{
Context *t = origin_trans_->context ();
- Link_array__Context_ r;
+ vector<Context*> r;
do
{
r.push_back (t);
SCM iface = scm_hashq_ref (all_ifaces, scm_car (ifs), SCM_BOOL_F);
if (iface == SCM_BOOL_F)
{
- std::string msg = to_string (_f ("Unknown interface `%s'",
+ string msg = to_string (_f ("Unknown interface `%s'",
ly_symbol2string (scm_car (ifs)).c_str ()));
programming_error (msg);
continue;
if (!found)
{
- std::string str = to_string (_f ("Grob `%s' has no interface for property `%s'",
+ string str = to_string (_f ("Grob `%s' has no interface for property `%s'",
me->name ().c_str (),
ly_symbol2string (sym).c_str ()));
programming_error (str);
void start_translation_timestep ();
void stop_translation_timestep ();
- std::vector<Grob_pq_entry> started_now_;
+ vector<Grob_pq_entry> started_now_;
};
Grob_pq_engraver::Grob_pq_engraver ()
MESSAGES
****************************************************************/
void
-Grob::warning (std::string s) const
+Grob::warning (string s) const
{
SCM cause = self_scm ();
while (Grob *g = unsmob_grob (cause))
}
-std::string
+string
Grob::name () const
{
SCM meta = get_property ("meta");
}
void
-Grob::programming_error (std::string s) const
+Grob::programming_error (string s) const
{
SCM cause = self_scm ();
while (Grob *g = unsmob_grob (cause))
}
Grob *
-common_refpoint_of_array (Link_array__Grob_ const &arr, Grob *common, Axis a)
+common_refpoint_of_array (vector<Grob*> const &arr, Grob *common, Axis a)
{
for (vsize i = arr.size (); i--;)
if (Grob *s = arr[i])
== 0))
return;
- Link_array__Grob_ childs;
+ vector<Grob*> childs;
Axis_group_interface::get_children (me, &childs);
for (vsize i = 0; i < childs.size (); i++)
childs[i]->suicide ();
{
public:
TRANSLATOR_DECLARATIONS (Horizontal_bracket_engraver);
- Link_array__Spanner_ bracket_stack_;
- Link_array__Music_ events_;
+ vector<Spanner*> bracket_stack_;
+ vector<Music*> events_;
vsize pop_count_;
vsize push_count_;
Stencil
Horizontal_bracket::make_enclosing_bracket (Grob *me, Grob *refpoint,
- Link_array__Grob_ grobs,
+ vector<Grob*> grobs,
Axis a, Direction dir)
{
Grob *common = common_refpoint_of_array (grobs, refpoint, a);
/** Set the new input file to NAME, remember old file. */
void
-Includable_lexer::new_input (std::string name, Sources *sources)
+Includable_lexer::new_input (string name, Sources *sources)
{
if (!allow_includes_b_)
{
Source_file *file = sources->get_file (name);
if (!file)
{
- std::string msg = _f ("can't find file: `%s'", name);
+ string msg = _f ("can't find file: `%s'", name);
msg += "\n";
msg += _f ("(search path: `%s')",
sources->path_->to_string ().c_str ());
state_stack_.push_back (yy_current_buffer);
if (be_verbose_global)
- progress_indication (std::string ("[") + name);
+ progress_indication (string ("[") + name);
include_stack_.push_back (file);
}
void
-Includable_lexer::new_input (std::string name, std::string data, Sources *sources)
+Includable_lexer::new_input (string name, string data, Sources *sources)
{
Source_file *file = new Source_file (name, data);
sources->add (file);
state_stack_.push_back (yy_current_buffer);
if (be_verbose_global)
- progress_indication (std::string ("[") + name);
+ progress_indication (string ("[") + name);
include_stack_.push_back (file);
yy_switch_to_buffer (yy_create_buffer (file->get_istream (), YY_BUF_SIZE));
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
static bool has_interface (Grob *);
- static std::string get_fontcharname (std::string style, int alteration);
- static std::vector<Box> accurate_boxes (Grob *me,
+ static string get_fontcharname (string style, int alteration);
+ static vector<Box> accurate_boxes (Grob *me,
Grob **common);
};
Item *item_col,
Grob *acc);
static void split_accidentals (Grob *accs,
- Link_array__Grob_ *break_reminder,
- Link_array__Grob_ *real_acc);
+ vector<Grob*> *break_reminder,
+ vector<Grob*> *real_acc);
DECLARE_SCHEME_CALLBACK(calc_positioning_done, (SCM));
static bool has_interface (Grob *);
All_font_metrics (All_font_metrics const &);
public:
- All_font_metrics (std::string search_path);
+ All_font_metrics (string search_path);
~All_font_metrics ();
#if HAVE_PANGO_FT2
Real scale);
#endif
- Tex_font_metric *find_tfm (std::string);
- Font_metric *find_font (std::string name);
- Open_type_font *find_otf (std::string name);
+ Tex_font_metric *find_tfm (string);
+ Font_metric *find_font (string name);
+ Open_type_font *find_otf (string name);
SCM font_descriptions () const;
};
void add_audio_item (Audio_item *i);
Moment at_mom () const;
- Link_array__Audio_item_ audio_items_;
+ vector<Audio_item*> audio_items_;
private:
Audio_column (Audio_column const &);
Music *event_;
Translator *origin_trans_;
- Link_array__Context_ origin_contexts (Translator *) const;
+ vector<Context*> origin_contexts (Translator *) const;
Audio_element_info (Audio_element *, Music *);
Audio_element_info ();
class Audio_instrument : public Audio_item
{
public:
- Audio_instrument (std::string instrument_string);
+ Audio_instrument (string instrument_string);
- std::string str_;
+ string str_;
};
class Audio_note : public Audio_item
class Audio_piano_pedal : public Audio_item
{
public:
- std::string type_string_;
+ string type_string_;
Direction dir_;
};
MARKER, CUE_POINT
};
- Audio_text (Audio_text::Type type, std::string text_string);
+ Audio_text (Audio_text::Type type, string text_string);
Type type_;
- std::string text_string_;
+ string text_string_;
};
class Audio_tempo : public Audio_item
void add_audio_item (Audio_item *l);
void output (Midi_stream &midi_stream_r, int track_i);
- Link_array__Audio_item_ audio_items_;
+ vector<Audio_item*> audio_items_;
int channel_;
};
{
protected:
Spanner *staffline_;
- Link_array__Grob_ elts_;
+ vector<Grob*> elts_;
void process_music ();
virtual void finalize ();
DECLARE_ACKNOWLEDGER (grob);
static SCM generic_group_extent (Grob *me, Axis a);
DECLARE_SCHEME_CALLBACK (width, (SCM smob));
DECLARE_SCHEME_CALLBACK (height, (SCM smob));
- static Interval relative_group_extent (Link_array__Grob_ const &list,
+ static Interval relative_group_extent (vector<Grob*> const &list,
Grob *common, Axis);
static void add_element (Grob *me, Grob *);
static void set_axes (Grob *, Axis, Axis);
static bool has_axis (Grob *, Axis);
- static void get_children (Grob *, Link_array__Grob_ *);
+ static void get_children (Grob *, vector<Grob*> *);
static bool has_interface (Grob *);
};
public:
static bool has_interface (Grob *);
- static Stencil compound_barline (Grob *, std::string, Real height, bool rounded);
+ static Stencil compound_barline (Grob *, string, Real height, bool rounded);
static Stencil simple_barline (Grob *, Real wid, Real height, bool rounded);
DECLARE_SCHEME_CALLBACK (calc_bar_size, (SCM));
DECLARE_SCHEME_CALLBACK (print, (SCM));
public:
static bool has_interface (Grob *);
- static Stencil compound_barline (Grob *, std::string, Real height);
+ static Stencil compound_barline (Grob *, string, Real height);
static Stencil simple_barline (Grob *, Real wid, Real height);
DECLARE_SCHEME_CALLBACK (get_staff_bar_size, (SCM));
DECLARE_SCHEME_CALLBACK (print, (SCM));
static Real score_slopes_dy (Real, Real, Real, Real, Real, bool, Beam_quant_parameters const *);
- static Real score_stem_lengths (Link_array__Grob_ const &stems,
- std::vector<Stem_info> const &stem_infos,
- std::vector<Real> const &base_stem_ys,
- std::vector<Real> const &stem_xs,
+ static Real score_stem_lengths (vector<Grob*> const &stems,
+ vector<Stem_info> const &stem_infos,
+ vector<Real> const &base_stem_ys,
+ vector<Real> const &stem_xs,
Real xl, Real xr,
bool knee,
Real yl, Real yr, Beam_quant_parameters const *);
*/
struct Beaming_info_list
{
- std::vector<Beaming_info> infos_;
+ vector<Beaming_info> infos_;
int beam_extend_count (Direction) const;
int best_splitpoint_index (Moment &beat_length, bool subdivide) const;
void translate (Offset);
Real get_other_coordinate (Axis a, Real x) const;
- std::vector<Real> solve_point (Axis, Real coordinate) const;
- std::vector<Real> solve_derivative (Offset) const;
+ vector<Real> solve_point (Axis, Real coordinate) const;
+ vector<Real> solve_derivative (Offset) const;
Interval extent (Axis) const;
Interval control_point_extent (Axis) const;
/*
Bezier curves always have 4 control points. Making this into an
- std::vector<> gives unnecessary overhead, and makes debugging a royal
+ vector<> gives unnecessary overhead, and makes debugging a royal
pain. */
Offset control_[4];
};
-void scale (std::vector<Offset> *array, Real xscale, Real yscale);
-void rotate (std::vector<Offset> *array, Real phi);
-void translate (std::vector<Offset> *array, Offset o);
+void scale (vector<Offset> *array, Real xscale, Real yscale);
+void rotate (vector<Offset> *array, Real phi);
+void translate (vector<Offset> *array, Offset o);
Bezier slur_shape (Real width, Real height_limit,
Real height_proportion);
class Binary_source_file : public Source_file
{
public:
- Binary_source_file (std::string &file_name_string);
+ Binary_source_file (string &file_name_string);
virtual ~Binary_source_file ();
U8 get_U8 ();
Byte get_Byte () {return get_U8 (); }
int get_int () { return get_U32 (); }
- virtual std::string quote_input (char const *pos_str0) const;
+ virtual string quote_input (char const *pos_str0) const;
virtual int get_line (char const *pos_str0) const;
};
DECLARE_SMOBS (Book, foo);
public:
- std::string user_key_;
+ string user_key_;
SCM header_;
Output_def *paper_;
SCM scores_;
Paper_score *pscore_;
Real linewidth_;
- Link_array__Grob_ find_breaks () const;
- std::vector<int> find_break_indices () const;
+ vector<Grob*> find_breaks () const;
+ vector<int> find_break_indices () const;
void solve_line (Column_x_positions *) const;
- bool feasible (Link_array__Grob_ const &) const;
+ bool feasible (vector<Grob*> const &) const;
- Simple_spacer_wrapper *generate_spacing_problem (Link_array__Grob_ const &,
+ Simple_spacer_wrapper *generate_spacing_problem (vector<Grob*> const &,
Interval) const;
- virtual std::vector<Column_x_positions> do_solve () const = 0;
+ virtual vector<Column_x_positions> do_solve () const = 0;
public:
virtual ~Break_algorithm ();
Simple_spacer *(*get_line_spacer) ();
Break_algorithm ();
void set_pscore (Paper_score *);
- std::vector<Column_x_positions> solve () const;
+ vector<Column_x_positions> solve () const;
};
#endif // BREAK_HH
class Break_align_interface
{
public:
- static Link_array__Grob_ ordered_elements (Grob *me);
+ static vector<Grob*> ordered_elements (Grob *me);
static bool has_interface (Grob *);
static void add_element (Grob *me, Grob *add);
DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM element));
DECLARE_CLASSNAME(Change_iterator);
private:
- void error (std::string);
+ void error (string);
};
#endif
protected:
virtual void build_ligature (Spanner *ligature,
- std::vector<Grob_info> primitives) = 0;
+ vector<Grob_info> primitives) = 0;
virtual void typeset_ligature (Spanner *ligature,
- std::vector<Grob_info> primitives);
+ vector<Grob_info> primitives);
virtual void get_set_column (Item *, Paper_column *);
private:
- void collect_accidentals (Spanner *, std::vector<Grob_info>);
+ void collect_accidentals (Spanner *, vector<Grob_info>);
};
#endif // COHERENT_LIGATURE_ENGRAVER_HH
struct Column_x_positions
{
- Link_array__Grob_ cols_;
- Link_array__Grob_ loose_cols_;
+ vector<Grob*> cols_;
+ vector<Grob*> loose_cols_;
- std::vector<Real> config_;
+ vector<Real> config_;
Real force_;
bool satisfies_constraints_;
SCM get_translator_names (SCM) const;
void set_acceptor (SCM accepts, bool add);
- Link_array__Context_def_ path_to_acceptable_context (SCM type_string,
+ vector<Context_def*> path_to_acceptable_context (SCM type_string,
Output_def *) const;
Context *instantiate (SCM extra_ops, Object_key const *);
int iterator_count_;
bool init_;
- map<std::string, int> grob_counts_;
- map<std::string, int> context_counts_;
+ map<string, int> grob_counts_;
+ map<string, int> context_counts_;
protected:
Object_key const *key_;
SCM accepts_list_;
SCM aliases_;
Translator_group *implementation_;
- std::string id_string_;
+ string id_string_;
friend class Context_def;
void clear_key_disambiguations ();
public:
Object_key const *key () const { return key_; }
- Object_key const *create_grob_key (std::string);
- Object_key const *get_grob_key (std::string);
- Object_key const *get_context_key (std::string, std::string);
+ Object_key const *create_grob_key (string);
+ Object_key const *get_grob_key (string);
+ Object_key const *get_context_key (string, string);
- Context *create_context (Context_def *, std::string, SCM);
- std::string id_string () const { return id_string_; }
+ Context *create_context (Context_def *, string, SCM);
+ string id_string () const { return id_string_; }
SCM children_contexts () const { return context_list_; }
SCM default_child_context_name () const;
Context *remove_context (Context *trans);
void check_removal ();
- std::string context_name () const;
+ string context_name () const;
SCM context_name_symbol () const;
Global_context *get_global_context () const;
bool try_music (Music *);
Context *find_create_context (SCM context_name,
- std::string id, SCM ops);
+ string id, SCM ops);
Context *create_unique_context (SCM context_name,
SCM ops);
- Link_array__Context_ path_to_acceptable_context (SCM alias,
+ vector<Context*> path_to_acceptable_context (SCM alias,
Output_def *) const;
};
SCM context_property, SCM grob_property_path, SCM val);
SCM updated_grob_properties (Context *tg, SCM sym);
Context *find_context_below (Context *where,
- SCM type_sym, std::string id);
+ SCM type_sym, string id);
bool melisma_busy (Context *);
Context *get_voice_to_lyrics (Context *lyrics);
#endif
-std::string print_dimen (Real);
+string print_dimen (Real);
const Real point_constant = 1 PT;
const Real inch_constant = 1 INCH;
const Real cm_constant = 1 CM;
Duration ();
Duration (int, int);
- std::string to_string () const;
+ string to_string () const;
Duration compressed (Rational) const;
Rational get_length () const;
class Engraver_group : public virtual Translator_group
{
protected:
- std::vector<Grob_info> announce_infos_;
+ vector<Grob_info> announce_infos_;
SCM acknowledge_hash_table_;
public:
VIRTUAL_COPY_CONSTRUCTOR (Translator_group, Engraver_group);
#include "std-string.hh"
-std::string map_file_name (std::string s);
+string map_file_name (string s);
#endif /* FILE_NAME_MAP_HH */
public:
SCM description_;
- std::string file_name_;
+ string file_name_;
- virtual Stencil text_stencil (std::string) const;
- virtual Box text_dimension (std::string) const;
- virtual std::string font_name () const;
+ virtual Stencil text_stencil (string) const;
+ virtual Box text_dimension (string) const;
+ virtual string font_name () const;
virtual vsize count () const;
- virtual Offset attachment_point (std::string) const;
+ virtual Offset attachment_point (string) const;
virtual Offset get_indexed_wxwy (vsize) const;
virtual Box get_indexed_char (vsize index) const;
virtual Box get_ascii_char (vsize ascii) const;
- virtual vsize name_to_index (std::string) const;
+ virtual vsize name_to_index (string) const;
virtual vsize index_to_charcode (vsize) const;
virtual vsize index_to_ascii (vsize) const;
virtual Real design_size () const;
- virtual Stencil find_by_name (std::string) const;
+ virtual Stencil find_by_name (string) const;
virtual Stencil get_indexed_char_stencil (vsize k) const;
virtual Stencil get_ascii_char_stencil (vsize k) const;
virtual SCM sub_fonts () const;
Font_metric ();
};
-int get_encoded_index (Font_metric *m, std::string input_coding, int code);
+int get_encoded_index (Font_metric *m, string input_coding, int code);
class Simple_font_metric : public Font_metric
{
void init_freetype ();
extern FT_Library freetype2_library;
-FT_Face open_ft_face (std::string str);
+FT_Face open_ft_face (string str);
#endif /* FREETYPE_HH */
*/
struct Gourlay_breaking : public Break_algorithm
{
- std::vector<Column_x_positions> do_solve () const;
+ vector<Column_x_positions> do_solve () const;
Gourlay_breaking ();
Real combine_demerits (Column_x_positions const &, Column_x_positions const &) const;
};
protected:
Gregorian_ligature_engraver ();
virtual bool try_music (Music *);
- virtual void build_ligature (Spanner *ligature, std::vector<Grob_info> primitives);
+ virtual void build_ligature (Spanner *ligature, vector<Grob_info> primitives);
virtual void transform_heads (Spanner *ligature,
- std::vector<Grob_info> primitives) = 0;
+ vector<Grob_info> primitives) = 0;
void stop_translation_timestep ();
};
{
public:
static bool has_interface (Grob *);
- static std::string prefixes_to_str (Grob *);
+ static string prefixes_to_str (Grob *);
};
/*
class Grob_array
{
- Link_array__Grob_ grobs_;
+ vector<Grob*> grobs_;
bool ordered_;
DECLARE_SIMPLE_SMOBS (Grob_array,);
bool empty () const;
void clear ();
void add (Grob *x) { grobs_.push_back (x); }
- void set_array (Link_array__Grob_ const &src);
- Link_array__Grob_ &array_reference ();
- Link_array__Grob_ const &array () const;
+ void set_array (vector<Grob*> const &src);
+ vector<Grob*> &array_reference ();
+ vector<Grob*> const &array () const;
static SCM make_array ();
};
DECLARE_UNSMOB (Grob_array, grob_array);
-Link_array__Grob_ const &ly_scm2link_array (SCM x);
+vector<Grob*> const &ly_scm2link_array (SCM x);
SCM grob_list_to_grob_array (SCM lst);
#endif /* GROB_ARRAY_HH */
Context *context () const;
Music *music_cause () const;
Music *ultimate_music_cause () const;
- Link_array__Context_ origin_contexts (Translator *) const;
+ vector<Context*> origin_contexts (Translator *) const;
Grob_info (Translator *, Grob *);
Grob_info ();
bool is_live () const;
/* naming. */
- std::string name () const;
+ string name () const;
/* Properties */
SCM get_property_alist_chain (SCM) const;
void internal_set_object (SCM sym, SCM val);
/* messages */
- void warning (std::string) const;
- void programming_error (std::string) const;
+ void warning (string) const;
+ void programming_error (string) const;
/* class hierarchy */
/* refpoints */
Grob *common_refpoint_of_list (SCM elt_list, Grob *, Axis a);
-Grob *common_refpoint_of_array (Link_array__Grob_ const &, Grob *, Axis a);
+Grob *common_refpoint_of_array (vector<Grob*> const &, Grob *, Axis a);
System *get_root_system (Grob *me);
/* extents */
DECLARE_SCHEME_CALLBACK (print, (SCM));
static Stencil make_bracket (Grob *, Real, Axis, Direction);
static Stencil make_enclosing_bracket (Grob *me, Grob *refpoint,
- Link_array__Grob_ grobs,
+ vector<Grob*> grobs,
Axis a, Direction dir);
static bool has_interface (Grob *);
};
*/
class Includable_lexer : public yyFlexLexer
{
- std::vector<YY_BUFFER_STATE> state_stack_;
+ vector<YY_BUFFER_STATE> state_stack_;
protected:
bool close_input ();
- Link_array__Source_file_ include_stack_;
- std::vector<int> char_count_stack_;
+ vector<Source_file*> include_stack_;
+ vector<int> char_count_stack_;
public:
bool allow_includes_b_;
~Includable_lexer ();
/// store dependencies for Makefile stuff.
- std::vector<std::string> file_name_strings_;
+ vector<string> file_name_strings_;
Source_file *get_source_file () const;
- void new_input (std::string s, Sources *);
- void new_input (std::string name, std::string data, Sources *);
+ void new_input (string s, Sources *);
+ void new_input (string name, string data, Sources *);
char const *here_str0 () const;
};
char const *end () const;
void set (Source_file *, char const *, char const *);
- void warning (std::string) const; // should use member func?
- void non_fatal_error (std::string) const;
- void error (std::string) const;
- void message (std::string) const;
+ void warning (string) const; // should use member func?
+ void non_fatal_error (string) const;
+ void error (string) const;
+ void message (string) const;
void set_spot (Input const &);
void step_forward ();
void set_location (Input const &, Input const &);
Input spot () const;
- std::string location_string () const;
- std::string line_number_string () const;
- std::string file_string ()const;
+ string location_string () const;
+ string line_number_string () const;
+ string file_string ()const;
int line_number ()const;
int column_number ()const;
*/
struct Keyword_table
{
- std::vector<Keyword_ent> table_;
+ vector<Keyword_ent> table_;
Keyword_table (Keyword_ent *);
vsize lookup (char const *s) const;
#include "std-string.hh"
-std::string kpathsea_find_tfm (char const *name);
+string kpathsea_find_tfm (char const *name);
void initialize_kpathsea (char *av0);
#endif /* KPATH_HH */
/**
Least squares minimisation in 2 variables.
*/
-void minimise_least_squares (Real *coef, Real *offset, std::vector<Offset> const &);
+void minimise_least_squares (Real *coef, Real *offset, vector<Offset> const &);
#endif // LEASTSQUARE_HH
void process_music ();
virtual Spanner *create_ligature_spanner () = 0;
virtual void typeset_ligature (Spanner *ligature,
- std::vector<Grob_info> primitives) = 0;
+ vector<Grob_info> primitives) = 0;
virtual Spanner *current_ligature ();
SCM brew_ligature_primitive_proc;
Drul_array<Music *> events_drul_;
Spanner *ligature_;
- std::vector<Grob_info> primitives_;
+ vector<Grob_info> primitives_;
Spanner *finished_ligature_;
- std::vector<Grob_info> finished_primitives_;
+ vector<Grob_info> finished_primitives_;
Music *prev_start_event_;
/*
Make TYPE::FUNC available as a Scheme function.
*/
-std::string mangle_cxx_identifier (std::string);
+string mangle_cxx_identifier (string);
#define MAKE_SCHEME_CALLBACK(TYPE, FUNC, ARGCOUNT) \
SCM TYPE ::FUNC ## _proc; \
void \
TYPE ## _ ## FUNC ## _init_functions () \
{ \
- std::string id = mangle_cxx_identifier (std::string (#TYPE) + "::" + std::string (#FUNC)); \
+ string id = mangle_cxx_identifier (string (#TYPE) + "::" + string (#FUNC)); \
TYPE ::FUNC ## _proc = scm_c_define_gsubr (id.c_str(), \
(ARGCOUNT), 0, 0, \
(Scheme_function_unknown) TYPE::FUNC); \
extern SCM global_lily_module;
-std::string gulp_file_to_string (std::string fn, bool must_exist, int size);
+string gulp_file_to_string (string fn, bool must_exist, int size);
-std::string ly_scm2string (SCM s);
-std::string ly_symbol2string (SCM);
+string ly_scm2string (SCM s);
+string ly_symbol2string (SCM);
SCM ly_offset2scm (Offset);
Offset ly_scm2offset (SCM);
SCM ly_chain_assoc (SCM key, SCM achain);
SCM ly_quote_scm (SCM s);
bool type_check_assignment (SCM val, SCM sym, SCM type_symbol);
-std::string print_scm_val (SCM val);
+string print_scm_val (SCM val);
SCM ly_number2string (SCM s);
SCM parse_symbol_list (char const *);
void ly_display_scm (SCM s);
}
-void read_lily_scm_file (std::string);
+void read_lily_scm_file (string);
void ly_c_init_guile ();
bool is_direction (SCM s);
DECLARE_SMOBS (Lily_lexer,);
private:
- int lookup_keyword (std::string);
- int scan_bare_word (std::string);
- SCM scan_markup_word (std::string);
- int scan_escaped_word (std::string);
+ int lookup_keyword (string);
+ int scan_bare_word (string);
+ SCM scan_markup_word (string);
+ int scan_escaped_word (string);
int identifier_type (SCM);
char escaped_char (char) const;
SCM scopes_;
SCM start_module_;
public:
- std::string main_input_name_;
+ string main_input_name_;
void *lexval;
Input *lexloc;
bool is_main_input_;
void start_main_input ();
- SCM lookup_identifier (std::string s);
+ SCM lookup_identifier (string s);
SCM lookup_identifier_symbol (SCM s);
void push_chord_state (SCM tab);
void push_figuredbass_state ();
DECLARE_SMOBS (Lily_parser,);
friend int yyparse (void *);
- std::vector<Input> define_spots_;
+ vector<Input> define_spots_;
char const *here_str0 () const;
Simultaneous_music *get_chord (Pitch tonic,
- std::vector<Pitch> *adds, std::vector<Pitch> *subs,
+ vector<Pitch> *adds, vector<Pitch> *subs,
Pitch *inversion, Pitch *bass, Duration d);
void set_chord_tremolo (int type_i);
void set_last_duration (Duration const *);
Lily_lexer *lexer_;
Sources *sources_;
Duration default_duration_;
- std::string output_basename_;
+ string output_basename_;
int fatal_error_;
int error_level_;
void do_init_file ();
void do_yyparse ();
- void parse_file (std::string init, std::string name, std::string out_name);
- void parse_string (std::string ly_code);
- void parser_error (std::string);
- void parser_error (Input const &, std::string);
+ void parse_file (string init, string name, string out_name);
+ void parse_string (string ly_code);
+ void parser_error (string);
+ void parser_error (Input const &, string);
void set_yydebug (bool);
};
#ifndef LILY_PROTO_HH
#define LILY_PROTO_HH
+
#include "flower-proto.hh"
class All_font_metrics;
typedef void (*Engraver_void_function_engraver_grob_info) (Engraver *, Grob_info);
typedef void (*Translator_void_method_ptr) (Translator *);
-
-/* FIXME: when Link_array is dropped, do grand s/r to vector<TYPE*>. */
-
-#include "std-vector.hh"
-
-#define Link_array__char_ std::vector<char*>
-#define Link_array__Grob_ std::vector<Grob*>
-#define Link_array__Accidental_placement_entry_ std::vector<Accidental_placement_entry*>
-#define Link_array__Audio_item_ std::vector<Audio_item*>
-#define Link_array__Audio_note_ std::vector<Audio_note*>
-#define Link_array__Audio_piano_pedal_ std::vector<Audio_piano_pedal*>
-#define Link_array__Audio_staff_ std::vector<Audio_staff*>
-#define Link_array__Bracket_nesting_node_ std::vector<Bracket_nesting_node*>
-#define Link_array__Context_ std::vector<Context*>
-#define Link_array__Context_def_ std::vector<Context_def*>
-#define Link_array__Grob_ std::vector<Grob*>
-#define Link_array__Item_ std::vector<Item*>
-#define Link_array__Music_ std::vector<Music*>
-#define Link_array__Note_column_ std::vector<Note_column*>
-#define Link_array__Output_def_ std::vector<Output_def*>
-#define Link_array__Slur_configuration_ std::vector<Slur_configuration*>
-#define Link_array__Source_file_ std::vector<Source_file*>
-#define Link_array__Spanner_ std::vector<Spanner*>
-#define Link_array__Tie_configuration_ std::vector<Tie_configuration*>
-
#endif /* LILY_PROTO_HH */
#include "std-string.hh"
-std::string version_string ();
-std::string gnu_lilypond_string ();
-std::string gnu_lilypond_version_string ();
+string version_string ();
+string gnu_lilypond_string ();
+string gnu_lilypond_version_string ();
#endif // LILY_VERSION_HH
struct Lilypond_version
{
Lilypond_version (int major, int minor, int patch);
- Lilypond_version (std::string str);
+ Lilypond_version (string str);
- std::string to_string () const;
+ string to_string () const;
operator int () const;
int major_;
int minor_;
int patch_;
- std::string extra_patch_string_;
+ string extra_patch_string_;
};
extern Lilypond_version oldest_version;
{
Object_key const *context_;
Moment creation_moment_;
- std::string grob_name_;
+ string grob_name_;
int disambiguation_count_;
public:
Lilypond_grob_key (Object_key const *context,
Moment start,
- std::string name, int);
+ string name, int);
static Object_key *from_scheme (SCM);
protected:
{
Object_key const *parent_context_;
Moment start_moment_;
- std::string context_name_;
- std::string id_;
+ string context_name_;
+ string id_;
int disambiguation_count_;
public:
Lilypond_context_key (Object_key const *parent,
Moment start,
- std::string type,
- std::string id,
+ string type,
+ string id,
int count);
static Object_key *from_scheme (SCM);
class Lilypond_general_key : public Object_key
{
Object_key const *parent_;
- std::string name_;
+ string name_;
int disambiguation_count_;
public:
- Lilypond_general_key (Object_key const *parent, std::string name,
+ Lilypond_general_key (Object_key const *parent, string name,
int count);
static Object_key *from_scheme (SCM);
static Stencil dot (Offset p, Real radius);
static Stencil bracket (Axis a, Interval iv, Real thick, Real protude, Real blot);
static Stencil accordion (SCM arg, Real interline_f, Font_metric *fm);
- static Stencil round_filled_polygon (std::vector<Offset> const &points, Real blotdiameter);
+ static Stencil round_filled_polygon (vector<Offset> const &points, Real blotdiameter);
static Stencil frame (Box b, Real thick, Real blot);
static Stencil slur (Bezier controls, Real cthick, Real thick);
static Stencil bezier_sandwich (Bezier top_curve, Bezier bottom_curve);
void do_scores ();
void clear_scores ();
void add_score (Score *s);
-void set_default_output (std::string s);
-std::string find_file (std::string);
+void set_default_output (string s);
+string find_file (string);
void call_constructors ();
-std::vector<std::string> get_inclusion_names ();
-void set_inclusion_names (std::vector<std::string>);
+vector<string> get_inclusion_names ();
+void set_inclusion_names (vector<string>);
-extern std::string init_name_global;
+extern string init_name_global;
/* options */
-extern std::vector<std::string> dump_header_fieldnames_global;
-extern std::string output_backend_global;
-extern std::string output_name_global;
+extern vector<string> dump_header_fieldnames_global;
+extern string output_backend_global;
+extern string output_name_global;
extern bool be_safe_global;
extern bool be_verbose_global;
extern bool do_internal_type_checking_global;
extern bool is_pango_format_global;
extern bool is_TeX_format_global;
extern bool point_and_click_global;
-extern std::string prefix_directory;
+extern string prefix_directory;
extern bool use_object_keys;
/*
todo: collect in Output_option struct?
*/
-extern std::string output_format_global;
+extern string output_format_global;
extern bool make_preview;
extern bool make_print;
/* misc */
-extern std::vector<std::string> failed_files;
+extern vector<string> failed_files;
extern int exit_status_global;
extern File_path global_path;
extern const char *LILYPOND_DATADIR;
/// factory
static Midi_item *get_midi (Audio_item *a);
- static std::string i2varint_string (int i);
+ static string i2varint_string (int i);
- virtual std::string to_string () const = 0;
+ virtual string to_string () const = 0;
int channel_;
};
Moment delta_mom_;
Midi_item *midi_;
- std::string to_string () const;
+ string to_string () const;
};
/**
class Midi_chunk : public Midi_item
{
public:
- void set (std::string header_string, std::string data_string, std::string footer_string);
- virtual std::string to_string () const;
- virtual std::string data_string () const;
+ void set (string header_string, string data_string, string footer_string);
+ virtual string to_string () const;
+ virtual string data_string () const;
DECLARE_CLASSNAME(Midi_chunk);
private:
- std::string data_string_;
- std::string footer_string_;
- std::string header_string_;
+ string data_string_;
+ string footer_string_;
+ string header_string_;
};
class Midi_duration : public Midi_item
public:
Midi_duration (Real seconds_f);
- virtual std::string to_string () const;
+ virtual string to_string () const;
Real seconds_;
};
Midi_instrument (Audio_instrument *);
DECLARE_CLASSNAME(Midi_instrument);
- virtual std::string to_string () const;
+ virtual string to_string () const;
Audio_instrument *audio_;
};
Midi_key (Audio_key *);
DECLARE_CLASSNAME(Midi_key);
- virtual std::string to_string () const;
+ virtual string to_string () const;
Audio_key *audio_;
};
Midi_time_signature (Audio_time_signature *);
DECLARE_CLASSNAME(Midi_time_signature);
- virtual std::string to_string () const;
+ virtual string to_string () const;
Audio_time_signature *audio_;
int clocks_per_1_;
Moment get_length () const;
int get_pitch () const;
int get_fine_tuning () const;
- virtual std::string to_string () const;
+ virtual string to_string () const;
Audio_note *audio_;
Midi_note_off (Midi_note *);
DECLARE_CLASSNAME(Midi_note_off);
- virtual std::string to_string () const;
+ virtual string to_string () const;
Midi_note *on_;
Byte aftertouch_byte_;
Midi_text (Audio_text *);
- virtual std::string to_string () const;
+ virtual string to_string () const;
Audio_text *audio_;
};
Midi_dynamic (Audio_dynamic *);
DECLARE_CLASSNAME(Midi_dynamic);
- virtual std::string to_string () const;
+ virtual string to_string () const;
Audio_dynamic *audio_;
};
Midi_piano_pedal (Audio_piano_pedal *);
DECLARE_CLASSNAME(Midi_piano_pedal);
- virtual std::string to_string () const;
+ virtual string to_string () const;
Audio_piano_pedal *audio_;
};
Midi_tempo (Audio_tempo *);
DECLARE_CLASSNAME(Midi_tempo);
- virtual std::string to_string () const;
+ virtual string to_string () const;
Audio_tempo *audio_;
};
Midi_track ();
void add (Moment delta_time_mom, Midi_item *midi);
- virtual std::string data_string () const;
+ virtual string data_string () const;
};
#endif // MIDI_ITEM_HH
/// Midi outputfile
struct Midi_stream
{
- Midi_stream (std::string file_name_string);
+ Midi_stream (string file_name_string);
~Midi_stream ();
- Midi_stream &operator << (std::string str);
+ Midi_stream &operator << (string str);
Midi_stream &operator << (Midi_item const &midi_c_r);
Midi_stream &operator << (int i);
void open ();
FILE *out_file_;
- std::string file_name_string_;
+ string file_name_string_;
};
#endif // MIDI_STREAM_HH
Midi_track *track_;
Audio_staff *staff_;
vsize index_;
- Link_array__Audio_item_ *items_;
+ vector<Audio_item*> *items_;
PQueue<Midi_note_event> stop_note_queue;
Moment last_mom_;
};
else return 0;
}
-std::vector<std::string> split_string (std::string s, char c);
+vector<string> split_string (string s, char c);
inline Real
linear_interpolate (Real x, Real x1, Real x2, Real y1, Real y2)
struct Modified_font_metric : public Font_metric
{
public:
- Box text_dimension (std::string) const;
- Stencil text_stencil (std::string) const;
+ Box text_dimension (string) const;
+ Stencil text_stencil (string) const;
static SCM make_scaled_font_metric (Font_metric *fm, Real magnification);
vsize count () const;
Offset get_indexed_wxwy (vsize) const;
- Offset attachment_point (std::string) const;
- vsize name_to_index (std::string) const;
+ Offset attachment_point (string) const;
+ vsize name_to_index (string) const;
vsize index_to_charcode (vsize) const;
Font_metric *original_font () const;
Modified_font_metric (Font_metric *fm, Real magnification);
SCM sub_fonts () const;
- std::string font_name () const;
+ string font_name () const;
Real design_size () const;
void derived_mark () const;
Box get_indexed_char (vsize) const;
vsize index_to_ascii (vsize) const;
Box get_ascii_char (vsize) const;
- Box tex_kludge (std::string) const;
+ Box tex_kludge (string) const;
};
#endif /* MODIFIED_FONT_METRIC_HH */
/*
Deliver a copy of THIS as a smobified SCM
*/
- std::string to_string () const;
+ string to_string () const;
static int compare (Moment const &, Moment const &);
SCM as_scheme () const;
};
#define IMPLEMENT_CTOR_CALLBACK(Class) \
LY_DEFINE_MEMBER_FUNCTION (Class, constructor, \
- mangle_cxx_identifier (std::string (#Class) + "::constructor").c_str(), \
+ mangle_cxx_identifier (string (#Class) + "::constructor").c_str(), \
0, 0, 0, \
(), \
"") \
class Note_collision_interface
{
public:
- static SCM automatic_shift (Grob *, Drul_array<Link_array__Grob_ >);
+ static SCM automatic_shift (Grob *, Drul_array<vector<Grob*> >);
static SCM forced_shift (Grob *);
- static Drul_array<Link_array__Grob_ > get_clash_groups (Grob *me);
+ static Drul_array<vector<Grob*> > get_clash_groups (Grob *me);
DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM smob));
static void add_column (Grob *me, Grob *ncol);
static bool has_interface (Grob *);
SCM get_char_table () const;
SCM glyph_list () const;
- std::string get_otf_table (std::string tag) const;
- static SCM make_otf (std::string);
- std::string font_name () const;
+ string get_otf_table (string tag) const;
+ static SCM make_otf (string);
+ string font_name () const;
~Open_type_font ();
- Offset attachment_point (std::string) const;
+ Offset attachment_point (string) const;
vsize count () const;
Box get_indexed_char (vsize) const;
- vsize name_to_index (std::string) const;
- //vsize glyph_name_to_charcode (std::string) const;
+ vsize name_to_index (string) const;
+ //vsize glyph_name_to_charcode (string) const;
vsize index_to_charcode (vsize) const;
void derived_mark () const;
SCM sub_fonts () const;
Real design_size () const;
};
-std::string get_otf_table (FT_Face face, std::string tag);
-FT_Face open_ft_face (std::string str);
+string get_otf_table (FT_Face face, string tag);
+FT_Face open_ft_face (string str);
#endif /* OPEN_TYPE_FONT_HH */
Output_def *parent_;
Input input_origin_;
- std::string user_key_;
+ string user_key_;
Lily_parser *parser_;
Lily_parser *get_parser () const;
/*
variables.
*/
- SCM c_variable (std::string id) const;
+ SCM c_variable (string id) const;
SCM lookup_variable (SCM sym) const;
void set_variable (SCM sym, SCM val);
Real get_dimension (SCM symbol) const;
~Pango_font ();
SCM font_file_name () const;
- void register_font_file (std::string, std::string);
- Stencil text_stencil (std::string) const;
- Stencil pango_item_string_stencil (PangoItem const *, std::string) const;
+ void register_font_file (string, string);
+ Stencil text_stencil (string) const;
+ Stencil pango_item_string_stencil (PangoItem const *, string) const;
virtual void derived_mark () const;
};
int breaks_; // used for stat printing
Paper_column *command_column_;
Paper_column *musical_column_;
- Link_array__Item_ items_;
+ vector<Item*> items_;
bool first_;
Moment last_moment_;
public:
class Paper_outputter
{
SCM output_module_;
- std::string file_name_;
+ string file_name_;
SCM file_;
public:
SCM file () const;
SCM dump_string (SCM);
void output_scheme (SCM scm);
- Paper_outputter (SCM port, std::string format);
+ Paper_outputter (SCM port, string format);
SCM scheme_to_string (SCM);
void output_stencil (Stencil);
void close ();
};
-Paper_outputter *get_paper_outputter (std::string, std::string);
+Paper_outputter *get_paper_outputter (string, string);
DECLARE_UNSMOB (Paper_outputter, outputter);
#endif /* PAPER_OUTPUTTER_HH */
System *root_system () const;
void typeset_system (System *);
- std::vector<Column_x_positions> calc_breaking ();
+ vector<Column_x_positions> calc_breaking ();
SCM get_paper_systems () const;
protected:
void output_header_track (Midi_stream &midi_stream_r);
void print () const;
- void write_output (std::string filename);
+ void write_output (string filename);
- Link_array__Audio_staff_ audio_staffs_;
+ vector<Audio_staff*> audio_staffs_;
Cons<Audio_element> *audio_element_list_;
Output_def *midi_;
};
virtual int get_tempo () const;
protected:
- std::vector<Audio_element_info> announce_infos_;
+ vector<Audio_element_info> announce_infos_;
private:
void acknowledge_audio_elements ();
int steps () const;
int semitone_pitch () const;
int quartertone_pitch () const;
- std::string to_string () const;
+ string to_string () const;
DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
DECLARE_SIMPLE_SMOBS (Pitch,);
INSTANTIATE_COMPARE (Pitch, Pitch::compare);
-int compare (std::vector<Pitch> *, std::vector<Pitch> *);
+int compare (vector<Pitch> *, vector<Pitch> *);
extern SCM pitch_less_proc;
Pitch pitch_interval (Pitch const &from, Pitch const &to);
static void add_grob (Grob *, SCM nm, SCM x);
};
-Link_array__Grob_ const &internal_extract_grob_array (Grob const *elt, SCM symbol);
-Link_array__Item_ internal_extract_item_array (Grob const *elt, SCM symbol);
+vector<Grob*> const &internal_extract_grob_array (Grob const *elt, SCM symbol);
+vector<Item*> internal_extract_item_array (Grob const *elt, SCM symbol);
#define extract_grob_array(x, prop) internal_extract_grob_array (x, ly_symbol2scm (prop))
#define extract_item_array(x, prop) internal_extract_item_array (x, ly_symbol2scm (prop))
representation of grob sets again.
*/
#define extract_grob_set(grob, prop, set) \
- Link_array__Grob_ const &set (internal_extract_grob_array (grob, ly_symbol2scm (prop)))
+ vector<Grob*> const &set (internal_extract_grob_array (grob, ly_symbol2scm (prop)))
#define extract_item_set(grob, prop, set) \
- Link_array__Item_ set (internal_extract_item_array (grob, ly_symbol2scm (prop)))
+ vector<Item*> set (internal_extract_item_array (grob, ly_symbol2scm (prop)))
#endif /* POINTER_GROUP_INTERFACE_HH */
public:
Prob (SCM, SCM);
Prob (Prob const &);
- virtual std::string name () const;
+ virtual string name () const;
SCM type () const { return type_; }
SCM get_property_alist (bool mutble) const;
SCM internal_get_property (SCM sym) const;
#include "std-string.hh"
-int sane_putenv (char const *key, std::string value, bool overwrite);
+int sane_putenv (char const *key, string value, bool overwrite);
void setup_paths (char const *argv0);
extern bool relocate_binary;
public:
DECLARE_SCHEME_CALLBACK (y_offset_callback, (SCM));
static bool has_interface (Grob *);
- static std::string glyph_name (Grob *, int, std::string, bool);
+ static string glyph_name (Grob *, int, string, bool);
static SCM brew_internal_stencil (Grob*, bool);
static SCM generic_extent_callback (Grob*, Axis);
DECLARE_SCHEME_CALLBACK (polyphonic_offset_callback, (SCM));
{
System *system_;
- Link_array__Grob_ elems_;
+ vector<Grob*> elems_;
Paper_score *pscore_;
void typeset_all ();
SCM music_;
public:
- Link_array__Output_def_ defs_;
- std::string user_key_;
+ vector<Output_def*> defs_;
+ string user_key_;
SCM header_;
bool error_found_;
class Separating_group_spanner
{
static void find_rods (Item *,
- Link_array__Grob_ const &separators,
+ vector<Grob*> const &separators,
vsize idx,
Real);
public:
class Simple_spacer
{
public:
- std::vector<Spring_description> springs_;
+ vector<Spring_description> springs_;
Real force_;
Real indent_;
Real line_len_;
struct Simple_spacer_wrapper
{
Simple_spacer *spacer_;
- Link_array__Grob_ spaced_cols_;
- Link_array__Grob_ loose_cols_;
+ vector<Grob*> spaced_cols_;
+ vector<Grob*> loose_cols_;
Simple_spacer_wrapper ();
- void add_columns (Link_array__Grob_ const &);
+ void add_columns (vector<Grob*> const &);
void solve (Column_x_positions *, bool);
~Simple_spacer_wrapper ();
private:
};
void
-merge_skyline (std::vector<Skyline_entry> *a1, std::vector<Skyline_entry> const &a2,
+merge_skyline (vector<Skyline_entry> *a1, vector<Skyline_entry> const &a2,
Direction);
-void insert_extent_into_skyline (std::vector<Skyline_entry> *line, Box b, Axis line_axis,
+void insert_extent_into_skyline (vector<Skyline_entry> *line, Box b, Axis line_axis,
Direction d);
-std::vector<Skyline_entry>
-extents_to_skyline (std::vector<Box> const &extents, Axis a, Direction d);
-std::vector<Skyline_entry> empty_skyline (Direction d);
-void heighten_skyline (std::vector<Skyline_entry> *buildings, Real ground);
+vector<Skyline_entry>
+extents_to_skyline (vector<Box> const &extents, Axis a, Direction d);
+vector<Skyline_entry> empty_skyline (Direction d);
+void heighten_skyline (vector<Skyline_entry> *buildings, Real ground);
Real
-skyline_meshing_distance (std::vector<Skyline_entry> const &buildings,
- std::vector<Skyline_entry> const &clouds);
+skyline_meshing_distance (vector<Skyline_entry> const &buildings,
+ vector<Skyline_entry> const &clouds);
Real
-skyline_height (std::vector<Skyline_entry> const &buildings,
+skyline_height (vector<Skyline_entry> const &buildings,
Real airplane, Direction sky_dir);
#endif /* SKYLINE_HH */
int index_;
#if DEBUG_SLUR_SCORING
- std::string score_card_;
+ string score_card_;
#endif
Slur_configuration ();
void generate_curve (Slur_score_state const &state, Real r0, Real h_inf,
- std::vector<Offset> const &);
+ vector<Offset> const &);
void score (Slur_score_state const &);
protected:
void score_extra_encompass (Slur_score_state const &);
bool has_same_beam_;
Real musical_dy_;
- Link_array__Grob_ columns_;
- std::vector<Encompass_info> encompass_infos_;
- std::vector<Extra_collision_info> extra_encompass_infos_;
+ vector<Grob*> columns_;
+ vector<Encompass_info> encompass_infos_;
+ vector<Extra_collision_info> extra_encompass_infos_;
Direction dir_;
Slur_score_parameters parameters_;
Drul_array<Bound_info> extremes_;
Drul_array<Offset> base_attachments_;
- Link_array__Slur_configuration_ configurations_;
+ vector<Slur_configuration*> configurations_;
Real staff_space_;
Real thickness_;
void fill (Grob *);
void set_next_direction ();
- std::vector<Offset> generate_avoid_offsets () const;
+ vector<Offset> generate_avoid_offsets () const;
Drul_array<Bound_info> get_bound_info () const;
void generate_curves () const;
- Link_array__Slur_configuration_ enumerate_attachments (Drul_array<Real> end_ys) const;
+ vector<Slur_configuration*> enumerate_attachments (Drul_array<Real> end_ys) const;
Drul_array<Offset> get_base_attachments () const;
Drul_array<Real> get_y_attachment_range () const;
Encompass_info get_encompass_info (Grob *col) const;
- std::vector<Extra_collision_info> get_extra_encompass_infos () const;
+ vector<Extra_collision_info> get_extra_encompass_infos () const;
Real move_away_from_staffline (Real y, Grob *on_staff) const;
int get_closest_index (SCM inspect_quants) const;
};
class Source_file
{
public:
- Source_file (std::string fn);
- Source_file (std::string, std::string);
+ Source_file (string fn);
+ Source_file (string, string);
virtual ~Source_file ();
char const *c_str () const;
- virtual std::string quote_input (char const *pos_str0) const;
+ virtual string quote_input (char const *pos_str0) const;
istream *get_istream ();
bool contains (char const *pos_str0) const;
int length () const;
virtual int get_line (char const *pos_str0) const;
- std::string name_string () const;
- std::string file_line_column_string (char const *str0) const;
+ string name_string () const;
+ string file_line_column_string (char const *str0) const;
// return start + n
char const *seek_str0 (int n);
// return here + n bytes
char const *forward_str0 (int n);
char const *pos_str0 () { return pos_str0_; }
- std::string get_string (int n);
+ string get_string (int n);
void set_pos (char const *pos_str0);
public:
Slice line_slice (char const *pos_str0) const;
- std::string line_string (char const *pos_str0) const;
+ string line_string (char const *pos_str0) const;
void get_counts (char const *pos_str0, int *, int *, int *) const;
/*
char const *pos_str0_;
SCM get_port () const;
- std::string name_;
+ string name_;
private:
- Link_array__char_ newline_locations_;
+ vector<char*> newline_locations_;
istream *istream_;
char *contents_str0_;
- std::vector<char> chs_;
+ vector<char> chs_;
int length_;
void load_stdin ();
void init_port ();
Protected_scm str_port_;
};
-char *gulp_file (std::string fn, int *len);
+char *gulp_file (string fn, int *len);
#endif /* SOURCE_FILE_HH */
Sources ();
~Sources ();
- Source_file *get_file (std::string &file_name);
+ Source_file *get_file (string &file_name);
Source_file *get_sourcefile (char const *);
void add (Source_file *sourcefile);
void set_path (File_path *);
static Real default_bar_spacing (Grob *, Grob *, Grob *, Moment);
static Real note_spacing (Grob *, Grob *, Grob *, Spacing_options const *, bool *);
static Real get_duration_space (Moment dur, Spacing_options const *, bool *);
- static Rational find_shortest (Grob *, Link_array__Grob_ const &);
- static Rational effective_shortest_duration (Grob *me, Link_array__Grob_ const &all);
+ static Rational find_shortest (Grob *, vector<Grob*> const &);
+ static Rational effective_shortest_duration (Grob *me, vector<Grob*> const &all);
static void breakable_column_spacing (Grob *, Item *l, Item *r, Spacing_options const *);
- static void prune_loose_columns (Grob *, Link_array__Grob_ *cols, Spacing_options const *);
- static void set_explicit_neighbor_columns (Link_array__Grob_ const &cols);
- static void set_implicit_neighbor_columns (Link_array__Grob_ const &cols);
- static void generate_springs (Grob *me, Link_array__Grob_ const &cols, Spacing_options const *);
+ static void prune_loose_columns (Grob *, vector<Grob*> *cols, Spacing_options const *);
+ static void set_explicit_neighbor_columns (vector<Grob*> const &cols);
+ static void set_implicit_neighbor_columns (vector<Grob*> const &cols);
+ static void generate_springs (Grob *me, vector<Grob*> const &cols, Spacing_options const *);
static void musical_column_spacing (Grob *, Item *, Item *, Spacing_options const *);
DECLARE_SCHEME_CALLBACK (set_springs, (SCM));
static bool has_interface (Grob *);
public:
DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
- Link_array__Spanner_ broken_intos_;
+ vector<Spanner*> broken_intos_;
vsize get_break_index () const;
class Stem
{
public:
- static std::vector<int> note_head_positions (Grob *);
+ static vector<int> note_head_positions (Grob *);
static int duration_log (Grob *);
static void set_beaming (Grob *, int, Direction d);
static int get_beaming (Grob *, Direction d);
using namespace std;
#if __GNUC__ > 2
-ostream *open_file_stream (std::string file_name,
+ostream *open_file_stream (string file_name,
ios_base::openmode mode = ios::out);
#else
-ostream *open_file_stream (std::string file_name, int mode = ios::out);
+ostream *open_file_stream (string file_name, int mode = ios::out);
#endif
void close_file_stream (ostream *os);
int element_count () const;
int spanner_count () const;
- void break_into_pieces (std::vector<Column_x_positions> const &);
+ void break_into_pieces (vector<Column_x_positions> const &);
static bool has_interface (Grob *);
- Link_array__Item_ broken_col_range (Item const *, Item const *) const;
- Link_array__Grob_ columns () const;
+ vector<Item*> broken_col_range (Item const *, Item const *) const;
+ vector<Grob*> columns () const;
void add_column (Paper_column *);
void typeset_grob (Grob *);
#include "lily-guile.hh"
#include "box.hh"
-void try_load_text_metrics (std::string);
+void try_load_text_metrics (string);
SCM ly_load_text_dimensions (SCM);
Box lookup_tex_text_dimension (Font_metric *font,
SCM text);
private:
Real get_U32_fix ();
Real get_U32_fix_scaled ();
- std::string get_bcpl_string ();
+ string get_bcpl_string ();
void read_header ();
void read_params ();
void read_char_metrics ();
Tex_font_char_metric read_char_metric (Char_code code);
Tex_font_char_metric read_char ();
- void read_lig_kern_program (std::vector<Tfm_ligature> *ligatures,
- std::vector<Tfm_kern> *kerns);
+ void read_lig_kern_program (vector<Tfm_ligature> *ligatures,
+ vector<Tfm_kern> *kerns);
Binary_source_file input_;
public:
- Tex_font_metric_reader (std::string name);
+ Tex_font_metric_reader (string name);
Tfm_info info_;
Tfm_header header_;
- std::vector<Tex_font_char_metric> char_metrics_;
- std::vector<vsize> ascii_to_metric_idx_;
+ vector<Tex_font_char_metric> char_metrics_;
+ vector<vsize> ascii_to_metric_idx_;
};
#endif /* TFM_READER_HH */
Char_code first_charcode, last_charcode;
U32 checksum;
Real design_size;
- std::string coding_scheme;
+ string coding_scheme;
unsigned parameter_count;
// Real parameters [Tex_font_metric::MAX_FONTDIMENS];
Real parameters [TFM_MAX_FONTDIMENS];
Char_code code_;
Real width_, height_, depth_, italic_correction_;
Fix width_fix_, height_fix_, depth_fix_, italic_correction_fix_;
- std::vector<Tfm_kern> kerns_;
- std::vector<Tfm_ligature> ligatures_;
+ vector<Tfm_kern> kerns_;
+ vector<Tfm_ligature> ligatures_;
Tex_font_char_metric ();
DECLARE_CLASSNAME(Tex_font_metric);
public:
- static SCM make_tfm (std::string file_name);
+ static SCM make_tfm (string file_name);
vsize count () const;
Box get_ascii_char (vsize) const;
Real design_size () const;
void derived_mark () const;
- vsize name_to_index (std::string) const;
- std::string font_name () const;
+ vsize name_to_index (string) const;
+ string font_name () const;
Tfm_info const &info () const;
protected:
Tfm_info info_;
Tfm_header header_;
- std::vector<Tex_font_char_metric> char_metrics_;
- std::vector<vsize> ascii_to_metric_idx_;
+ vector<Tex_font_char_metric> char_metrics_;
+ vector<vsize> ascii_to_metric_idx_;
SCM encoding_table_;
- std::string font_name_;
+ string font_name_;
private:
Tex_font_char_metric const *find_ascii (vsize ascii, bool warn = true) const;
#include "lily-proto.hh"
#include "tie-configuration.hh"
-void set_chord_outline (std::vector<Skyline_entry> *skyline,
- Link_array__Item_ bounds,
+void set_chord_outline (vector<Skyline_entry> *skyline,
+ vector<Item*> bounds,
Grob *common,
Direction d);
void set_tie_config_directions (Ties_configuration *tie_configs_ptr);
Tie_formatting_problem const&,
Grob *staff_referencer);
void
-set_chord_outlines (Drul_array< std::vector<Skyline_entry> > *skyline_drul,
- Link_array__Grob_ ties,
+set_chord_outlines (Drul_array< vector<Skyline_entry> > *skyline_drul,
+ vector<Grob*> ties,
Grob *common);
void
INSTANTIATE_COMPARE (Tie_configuration, Tie_configuration::compare);
-typedef std::vector<Tie_configuration> Ties_configuration;
+typedef vector<Tie_configuration> Ties_configuration;
#endif /* TIE_CONFIGURATION_HH */
class Tie_formatting_problem
{
- Drul_array< std::vector<Skyline_entry> > chord_outlines_;
+ Drul_array< vector<Skyline_entry> > chord_outlines_;
Drul_array< Box > stem_extents_;
set<int> dot_positions_;
Interval dot_x_;
- std::vector<Tie_specification> specifications_;
+ vector<Tie_specification> specifications_;
Tie_configuration_map possibilities_;
Tie_configuration *get_configuration (int position, Direction dir);
Tie_configuration *generate_configuration (int position, Direction dir) const;
- std::vector<Tie_configuration_variation> get_variations (Ties_configuration const &ties);
+ vector<Tie_configuration_variation> get_variations (Ties_configuration const &ties);
Real score_configuration (Tie_configuration const &) const;
Real score_aptitude (Tie_configuration const &, Tie_specification const &) const;
Ties_configuration generate_optimal_chord_configuration ();
Ties_configuration generate_ties_configuration (Ties_configuration const &);
Tie_configuration find_optimal_tie_configuration (Tie_specification const &) const;
- void from_ties (Link_array__Grob_ const &ties);
+ void from_ties (vector<Grob*> const &ties);
void from_tie (Grob *tie);
- void from_lv_ties (Link_array__Grob_ const &);
- void set_chord_outline (Link_array__Item_, Direction);
+ void from_lv_ties (vector<Grob*> const &);
+ void set_chord_outline (vector<Item*>, Direction);
void set_manual_tie_configuration (SCM);
Interval get_attachment (Real) const;
Grob *common_x_refpoint () const;
class Engraver_dispatch_list
{
- std::vector<Engraver_dispatch_entry> dispatch_entries_;
+ vector<Engraver_dispatch_entry> dispatch_entries_;
public:
void apply (Grob_info);
SCM static create (SCM trans_list,
{
private:
void precompute_method_bindings ();
- std::vector<Translator_method_binding>
+ vector<Translator_method_binding>
precomputed_method_bindings_[TRANSLATOR_METHOD_PRECOMPUTE_COUNT];
Translator_group_void_method
NAME (); \
VIRTUAL_COPY_CONSTRUCTOR (Translator, NAME); \
static SCM static_description_; \
- static std::vector<Acknowledge_information> acknowledge_static_array_; \
+ static vector<Acknowledge_information> acknowledge_static_array_; \
virtual void fetch_precomputable_methods (Translator_void_method_ptr methods[]); \
virtual SCM static_translator_description () const; \
virtual SCM translator_description () const; \
ADD_GLOBAL_CTOR (_ ## T ## _adder);
#define ADD_TRANSLATOR(classname, desc, grobs, accepted, read, write) \
- std::vector<Acknowledge_information> classname::acknowledge_static_array_; \
+ vector<Acknowledge_information> classname::acknowledge_static_array_; \
IMPLEMENT_FETCH_PRECOMPUTABLE_METHODS (classname); \
ADD_THIS_TRANSLATOR (classname); \
Engraver_void_function_engraver_grob_info \
void add_acknowledger (Engraver_void_function_engraver_grob_info ptr,
char const *func_name,
- std::vector<Acknowledge_information> *ack_array);
+ vector<Acknowledge_information> *ack_array);
Engraver_void_function_engraver_grob_info
generic_get_acknowledger (SCM sym,
- std::vector<Acknowledge_information> const *ack_array);
+ vector<Acknowledge_information> const *ack_array);
#define ADD_ACKNOWLEDGER(CLASS, NAME) \
void CLASS ## NAME ## _ack_adder () \
static void get_bounds (Grob *, Grob **, Grob **);
static void add_column (Grob *me, Item *);
static void add_beam (Grob *me, Grob *);
- static Grob *parallel_beam (Grob *me, Link_array__Grob_ const &cols, bool *equally_long);
+ static Grob *parallel_beam (Grob *me, vector<Grob*> const &cols, bool *equally_long);
static void calc_position_and_height (Grob *, Real *, Real *dy);
static Stencil make_bracket (Grob *me, Axis protusion_axis,
Offset dz, Drul_array<Real> height,
class Type_swallow_translator : public Translator
{
protected:
- std::string swallow_string_;
+ string swallow_string_;
bool try_music (Music *);
public:
VIRTUAL_COPY_CONS (Translator);
msg = scm_simple_format (SCM_BOOL_F, msg, rest);
- std::string m = ly_scm2string (msg);
+ string m = ly_scm2string (msg);
ip->message (m);
return SCM_UNSPECIFIED;
static int
print_smob (SCM s, SCM port, scm_print_state *)
{
- std::string str = "#<location " + unsmob_input (s)->location_string () + ">";
+ string str = "#<location " + unsmob_input (s)->location_string () + ">";
scm_puts (str.c_str (), port);
return 1;
}
[file:line:column:][warning:]message
*/
void
-Input::message (std::string s) const
+Input::message (string s) const
{
if (source_file_)
s = location_string () + ": " + s + "\n"
}
void
-Input::warning (std::string s) const
+Input::warning (string s) const
{
message (_f ("warning: %s", s));
}
void
-Input::error (std::string s) const
+Input::error (string s) const
{
message (_f ("error: %s", s));
// UGH, fix naming or usage
}
void
-Input::non_fatal_error (std::string s) const
+Input::non_fatal_error (string s) const
{
message (_f ("error: %s", s));
}
-std::string
+string
Input::location_string () const
{
if (source_file_)
return " (" + _ ("position unknown") + ")";
}
-std::string
+string
Input::line_number_string () const
{
if (source_file_)
return "?";
}
-std::string
+string
Input::file_string () const
{
if (source_file_)
Real inter = Staff_symbol_referencer::staff_space (me) / 2.0;
SCM scm_style = me->get_property ("style");
- std::string style;
+ string style;
if (scm_is_symbol (scm_style))
style = ly_symbol2string (scm_style);
else
for (SCM s = newas; scm_is_pair (s); s = scm_cdr (s))
{
int alteration = scm_to_int (scm_cdar (s));
- std::string font_char
+ string font_char
= Accidental_interface::get_fontcharname (style, alteration);
Stencil acc (fm->find_by_name ("accidentals." + font_char));
Music *event_;
Grob *lv_column_;
- Link_array__Grob_ lv_ties_;
+ vector<Grob*> lv_ties_;
void stop_translation_timestep ();
DECLARE_ACKNOWLEDGER (note_head);
Grob *me = unsmob_grob (smob);
extract_grob_set (me, "ties", lv_ro_ties);
- Link_array__Grob_ lv_ties (lv_ro_ties);
+ vector<Grob*> lv_ties (lv_ro_ties);
vector_sort (lv_ties, &Laissez_vibrer_tie::compare);
void
minimise_least_squares (Real *coef, Real *offset,
- std::vector<Offset> const &input)
+ vector<Offset> const &input)
{
Real sx = 0.0;
Real sy = 0.0;
*/
#define isatty HORRIBLEKLUDGE
-void strip_trailing_white (std::string&);
-void strip_leading_white (std::string&);
-std::string lyric_fudge (std::string s);
+void strip_trailing_white (string&);
+void strip_leading_white (string&);
+string lyric_fudge (string s);
int music_function_type (SCM);
-SCM lookup_markup_command (std::string s);
-bool is_valid_version (std::string s);
+SCM lookup_markup_command (string s);
+bool is_valid_version (string s);
#define start_quote() \
yy_push_state (quote);\
- yylval.string = new std::string
+ yylval.string = new string
#define start_lyric_quote() \
yy_push_state (lyric_quote);\
- yylval.string = new std::string
+ yylval.string = new string
#define yylval \
(*(YYSTYPE*)lexval)
*/
-SCM scan_fraction (std::string);
+SCM scan_fraction (string);
SCM (* scm_parse_error_handler) (void *);
yy_push_state (sourcefilename);
}
<version>\"[^"]*\" { /* got the version number */
- std::string s (YYText () + 1);
+ string s (YYText () + 1);
s = s.substr (0, s.rfind ('\"'));
yy_pop_state ();
}
<sourcefilename>\"[^"]*\" {
- std::string s (YYText () + 1);
+ string s (YYText () + 1);
s = s.substr (0, s.rfind ('\"'));
yy_pop_state ();
yy_push_state (incl);
}
<incl>\"[^"]*\" { /* got the include file name */
- std::string s (YYText ()+1);
+ string s (YYText ()+1);
s = s.substr (0, s.rfind ('"'));
new_input (s, sources_);
yy_pop_state ();
}
<incl>\\{BLACK}*{WHITE} { /* got the include identifier */
- std::string s = YYText () + 1;
+ string s = YYText () + 1;
strip_trailing_white (s);
if (s.length () && (s[s.length () - 1] == ';'))
s = s.substr (0, s.length () - 1);
new_input (ly_scm2string (sid), sources_);
yy_pop_state ();
} else {
- std::string msg (_f ("wrong or undefined identifier: `%s'", s ));
+ string msg (_f ("wrong or undefined identifier: `%s'", s ));
LexerError (msg.c_str ());
SCM err = scm_current_error_port ();
}
{DIGIT} {
- yylval.i = String_convert::dec2int (std::string (YYText ()));
+ yylval.i = String_convert::dec2int (string (YYText ()));
return DIGIT;
}
{UNSIGNED} {
- yylval.i = String_convert::dec2int (std::string (YYText ()));
+ yylval.i = String_convert::dec2int (string (YYText ()));
return UNSIGNED;
}
{E_UNSIGNED} {
- yylval.i = String_convert::dec2int (std::string (YYText () +1));
+ yylval.i = String_convert::dec2int (string (YYText () +1));
return E_UNSIGNED;
}
\" {
yy_pop_state ();
/* yylval is union. Must remember STRING before setting SCM*/
- std::string *sp = yylval.string;
+ string *sp = yylval.string;
yylval.scm = scm_makfrom0str (sp->c_str ());
delete sp;
return STRING;
yy_pop_state ();
/* yylval is union. Must remember STRING before setting SCM*/
- std::string *sp = yylval.string;
+ string *sp = yylval.string;
yylval.scm = scm_makfrom0str (sp->c_str ());
delete sp;
return LYRICS_STRING;
return FRACTION;
}
{UNSIGNED} {
- yylval.i = String_convert::dec2int (std::string (YYText ()));
+ yylval.i = String_convert::dec2int (string (YYText ()));
return UNSIGNED;
}
{NOTECOMMAND} {
}
{LYRICS} {
/* ugr. This sux. */
- std::string s (YYText ());
+ string s (YYText ());
if (s == "__")
return yylval.i = EXTENDER;
if (s == "--")
return FRACTION;
}
{UNSIGNED} {
- yylval.i = String_convert::dec2int (std::string (YYText ()));
+ yylval.i = String_convert::dec2int (string (YYText ()));
return UNSIGNED;
}
\" {
return SCORE;
}
{MARKUPCOMMAND} {
- std::string str (YYText () + 1);
+ string str (YYText () + 1);
SCM s = lookup_markup_command (str);
if (scm_is_pair (s) && scm_is_symbol (scm_cdr (s)) ) {
return YYText ()[0];
}
[^#{}"\\ \t\n\r\f]+ {
- std::string s (YYText ());
+ string s (YYText ());
char c = s[s.length () - 1];
/* brace open is for not confusing dumb tools. */
}
{UNSIGNED} {
- yylval.i = String_convert::dec2int (std::string (YYText ()));
+ yylval.i = String_convert::dec2int (string (YYText ()));
return UNSIGNED;
}
}
<*>. {
- std::string msg = _f ("invalid character: `%c'", YYText ()[0]);
+ string msg = _f ("invalid character: `%c'", YYText ()[0]);
LexerError (msg.c_str ());
return YYText ()[0];
}
int
-Lily_lexer::scan_escaped_word (std::string str)
+Lily_lexer::scan_escaped_word (string str)
{
// use more SCM for this.
return identifier_type (sid);
}
- std::string msg (_f ("unknown escaped string: `\\%s'", str));
+ string msg (_f ("unknown escaped string: `\\%s'", str));
LexerError (msg.c_str ());
yylval.scm = scm_makfrom0str (str.c_str ());
}
int
-Lily_lexer::scan_bare_word (std::string str)
+Lily_lexer::scan_bare_word (string str)
{
SCM sym = ly_symbol2scm (str.c_str ());
if ((YYSTATE == notes) || (YYSTATE == chords)) {
}
/*
- urg, belong to std::string (_convert)
+ urg, belong to string (_convert)
and should be generalised
*/
void
-strip_leading_white (std::string&s)
+strip_leading_white (string&s)
{
ssize i = 0;
for (; i < s.length (); i++)
}
void
-strip_trailing_white (std::string&s)
+strip_trailing_white (string&s)
{
ssize i = s.length ();
while (i--)
bool
-is_valid_version (std::string s)
+is_valid_version (string s)
{
Lilypond_version current ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL );
Lilypond_version ver (s);
/*
substitute _ and \,
*/
-std::string
-lyric_fudge (std::string s)
+string
+lyric_fudge (string s)
{
char *chars = string_copy (s);
*p = ' ';
}
- s = std::string (chars);
+ s = string (chars);
delete[] chars;
ssize i = 0;
Convert "NUM/DEN" into a '(NUM . DEN) cons.
*/
SCM
-scan_fraction (std::string frac)
+scan_fraction (string frac)
{
ssize i = frac.find ('/');
- std::string left = frac.substr (0, i);
- std::string right = frac.substr (i + 1, (frac.length () - i + 1));
+ string left = frac.substr (0, i);
+ string right = frac.substr (i + 1, (frac.length () - i + 1));
int n = String_convert::dec2int (left);
int d = String_convert::dec2int (right);
}
SCM
-lookup_markup_command (std::string s)
+lookup_markup_command (string s)
{
SCM proc = ly_lily_module_constant ("lookup-markup-command");
return scm_call_1 (proc, scm_makfrom0str (s.c_str ()));
protected:
virtual Spanner *create_ligature_spanner ();
virtual void typeset_ligature (Spanner *ligature,
- std::vector<Grob_info> primitives);
+ vector<Grob_info> primitives);
DECLARE_ACKNOWLEDGER (rest);
DECLARE_ACKNOWLEDGER (note_column);
public:
}
void
-Ligature_bracket_engraver::typeset_ligature (Spanner *, std::vector<Grob_info>)
+Ligature_bracket_engraver::typeset_ligature (Spanner *, vector<Grob_info>)
{
// no real ligature to typeset; the LigatureBracket just does it
}
*
* A concrete ligature engraver must subclass this class and provide
* functions create_ligature_spanner () and typeset_ligature
- * (Spanner *, std::vector<Grob_info>). Subclasses of this class basically
+ * (Spanner *, vector<Grob_info>). Subclasses of this class basically
* fall into two categories.
*
* The first category consists of engravers that engrave ligatures in
return scm_list_n (ly_symbol2scm ("quote"), s, SCM_UNDEFINED);
}
-std::string
+string
ly_symbol2string (SCM s)
{
/*
return ly_scm2string (str);
}
-std::string
-gulp_file_to_string (std::string fn, bool must_exist, int size)
+string
+gulp_file_to_string (string fn, bool must_exist, int size)
{
- std::string s = global_path.find (fn);
+ string s = global_path.find (fn);
if (s == "")
{
if (must_exist)
{
- std::string e = _f ("can't find file: `%s'", fn);
+ string e = _f ("can't find file: `%s'", fn);
e += " ";
e += _f ("(load path: `%s')", global_path.to_string ());
error (e);
int n = size;
char *str = gulp_file (s, &n);
- std::string result (str, n);
+ string result (str, n);
delete[] str;
if (be_verbose_global)
}
};
-std::string
+string
ly_scm2string (SCM str)
{
assert (scm_is_string (str));
- return std::string (scm_i_string_chars (str),
+ return string (scm_i_string_chars (str),
(int) scm_i_string_length (str));
}
}
typedef void (*Void_fptr) ();
-std::vector<Void_fptr> *scm_init_funcs_;
+vector<Void_fptr> *scm_init_funcs_;
void add_scm_init_func (void (*f) ())
{
if (!scm_init_funcs_)
- scm_init_funcs_ = new std::vector<Void_fptr>;
+ scm_init_funcs_ = new vector<Void_fptr>;
scm_init_funcs_->push_back (f);
}
}
SCM
-ly_string_array_to_scm (std::vector<std::string> a)
+ly_string_array_to_scm (vector<string> a)
{
SCM s = SCM_EOL;
for (vsize i = a.size (); i ; i--)
{
while (isspace (*symbols))
*symbols++;
- std::string s = symbols;
+ string s = symbols;
replace_all (s, '\n', ' ');
replace_all (s, '\t', ' ');
return ly_string_array_to_scm (String_convert::split (s, ' '));
return lst;
}
-std::string
+string
print_scm_val (SCM val)
{
- std::string realval = ly_scm2string (ly_write2scm (val));
+ string realval = ly_scm2string (ly_write2scm (val));
if (realval.length () > 200)
realval = realval.substr (0, 100)
+ "\n :\n :\n"
return scm_to_int (fixed);
}
-std::string
-mangle_cxx_identifier (std::string cxx_id)
+string
+mangle_cxx_identifier (string cxx_id)
{
if (cxx_id.substr (0, 3) == "ly_")
cxx_id = cxx_id.replace (0, 3, "ly:");
}
int
-Lily_lexer::lookup_keyword (std::string s)
+Lily_lexer::lookup_keyword (string s)
{
return keytable_->lookup (s.c_str ());
}
}
SCM
-Lily_lexer::lookup_identifier (std::string name)
+Lily_lexer::lookup_identifier (string name)
{
return lookup_identifier_symbol (ly_symbol2scm (name.c_str ()));
}
{
if (lookup_keyword (ly_symbol2string (sym)) >= 0)
{
- std::string symstr = ly_symbol2string (sym);
+ string symstr = ly_symbol2string (sym);
warning (_f ("identifier name is a keyword: `%s'", symstr.c_str ()));
}
char const *file = scm_i_string_chars (name);
char const *extensions[] = {"ly", "", 0};
- std::string file_name = global_path.find (file, extensions);
+ string file_name = global_path.find (file, extensions);
/* By default, use base name of input file for output file name,
write output to cwd; do not use root and directory parts of input
out_file_name = File_name (output_name_global);
}
- std::string init;
+ string init;
if (!init_name_global.empty ())
init = init_name_global;
else
init = "init.ly";
- std::string out_file = out_file_name.to_string ();
+ string out_file = out_file_name.to_string ();
if (init.length () && global_path.find (init).empty ())
{
Sources sources;
sources.set_path (&global_path);
- std::string mapped_fn = map_file_name (file_name);
+ string mapped_fn = map_file_name (file_name);
message (_f ("Processing `%s'", mapped_fn.c_str ()));
progress_indication ("\n");
/* Process one .ly file, or book. */
void
-Lily_parser::parse_file (std::string init, std::string name, std::string out_name)
+Lily_parser::parse_file (string init, string name, string out_name)
{
if (output_backend_global == "tex")
try_load_text_metrics (out_name);
lexer_->new_input (init, sources_);
File_name f (name);
- std::string s = global_path.find (f.base_ + ".twy");
+ string s = global_path.find (f.base_ + ".twy");
s = gulp_file_to_string (s, false, -1);
scm_eval_string (scm_makfrom0str (s.c_str ()));
}
void
-Lily_parser::parse_string (std::string ly_code)
+Lily_parser::parse_string (string ly_code)
{
// TODO: use $parser
lexer_->set_identifier (ly_symbol2scm ("parser"),
}
void
-Lily_parser::parser_error (std::string s)
+Lily_parser::parser_error (string s)
{
lexer_->here_input ().error (_ (s.c_str ()));
error_level_ = 1;
}
void
-Lily_parser::parser_error (Input const &i, std::string s)
+Lily_parser::parser_error (Input const &i, string s)
{
i.error (s);
error_level_ = 1;
#include "config.hh"
#include "version.hh"
-std::string
+string
version_string ()
{
- std::string str = MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL;
- std::string mpl ("." MY_PATCH_LEVEL);
+ string str = MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL;
+ string mpl ("." MY_PATCH_LEVEL);
if (mpl != ".")
str += mpl;
return str;
}
-std::string
+string
gnu_lilypond_string ()
{
- std::string str = "GNU LilyPond";
+ string str = "GNU LilyPond";
return str;
}
-std::string
+string
gnu_lilypond_version_string ()
{
- std::string str = gnu_lilypond_string () + " " + version_string ();
+ string str = gnu_lilypond_string () + " " + version_string ();
return str;
}
Lilypond_grob_key::Lilypond_grob_key (Object_key const *context,
Moment start,
- std::string name,
+ string name,
int disambiguation_count)
{
context_ = context;
Lilypond_context_key::Lilypond_context_key (Object_key const *parent,
Moment start,
- std::string type,
- std::string id,
+ string type,
+ string id,
int count)
{
disambiguation_count_ = count;
}
Lilypond_general_key::Lilypond_general_key (Object_key const *parent,
- std::string name,
+ string name,
int count)
{
parent_ = parent;
patch_ = patch;
}
-Lilypond_version::Lilypond_version (std::string str)
+Lilypond_version::Lilypond_version (string str)
{
major_ = 0;
minor_ = 0;
patch_ = 0;
- std::vector<std::string> version;
+ vector<string> version;
version = String_convert::split (str, '.');
if (version.size () > 0 && isdigit (version[0][0]))
extra_patch_string_ = version[3];
}
-std::string
+string
Lilypond_version::to_string () const
{
- return std::to_string (major_) + "." + std::to_string (minor_) + "." + std::to_string (patch_);
+ return ::to_string (major_)
+ + "." + ::to_string (minor_)
+ + "." + ::to_string (patch_);
}
Lilypond_version::operator int () const
Real length, Real width)
{
Real angle = (end - begin).arg ();
- std::vector<Offset> points;
+ vector<Offset> points;
points.push_back (Offset (0, 0));
points.push_back (Offset (-length, width));
* shrinked polygon). --jr
*/
Stencil
-Lookup::round_filled_polygon (std::vector<Offset> const &points,
+Lookup::round_filled_polygon (vector<Offset> const &points,
Real blotdiameter)
{
/* TODO: Maybe print a warning if one of the above limitations
return Line_interface::make_line (blotdiameter, points[0], points[1]);
/* shrink polygon in size by 0.5 * blotdiameter */
- std::vector<Offset> shrunk_points;
+ vector<Offset> shrunk_points;
shrunk_points.resize (points.size ());
bool ccw = 1; // true, if three adjacent points are counterclockwise ordered
for (vsize i = 0; i < points.size (); i++)
Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
{
Stencil m;
- std::string sym = ly_scm2string (scm_car (s));
- std::string reg = ly_scm2string (scm_car (scm_cdr (s)));
+ string sym = ly_scm2string (scm_car (s));
+ string reg = ly_scm2string (scm_car (scm_cdr (s)));
if (sym == "Discant")
{
Lookup::repeat_slash (Real w, Real s, Real t)
{
#if 0 /* TODO */
- std::vector<Offset> points;
+ vector<Offset> points;
Real blotdiameter = 0.0;
Offset p1 (0, 0);
return c;
SCM voice_name = lyrics->get_property ("associatedVoice");
- std::string nm = lyrics->id_string ();
+ string nm = lyrics->id_string ();
if (scm_is_string (voice_name))
nm = ly_scm2string (voice_name);
void process_music ();
private:
- Link_array__Music_ events_;
+ vector<Music*> events_;
Audio_text *audio_;
};
*/
/* Names of header fields to be dumped to a separate file. */
-std::vector<std::string> dump_header_fieldnames_global;
+vector<string> dump_header_fieldnames_global;
/* Name of initialisation file. */
-std::string init_name_global;
+string init_name_global;
/* Selected output backend
One of (gnome, ps [default], eps, scm, svg, tex, texstr)") */
-std::string output_backend_global = "ps";
+string output_backend_global = "ps";
/* Output formats to generate. */
-std::string output_format_global = "";
+string output_format_global = "";
bool is_pango_format_global;
bool is_TeX_format_global;
/* Current output name. */
-std::string output_name_global;
+string output_name_global;
/* Run in safe mode? */
bool be_safe_global = false;
/* Scheme code to execute before parsing, after .scm init.
This is where -e arguments are appended to. */
-std::string init_scheme_code_string;
-std::string init_scheme_variables;
+string init_scheme_code_string;
+string init_scheme_variables;
/* Generate preview of first system. */
bool make_preview = false;
/* Where the init files live. Typically:
LILYPOND_DATADIR = /usr/share/lilypond
*/
-std::string prefix_directory;
+string prefix_directory;
/* The jail specification: USER,GROUP,JAIL,DIR. */
-std::string jail_spec;
+string jail_spec;
/* The option parser */
static Getopt_long *option_parser = 0;
}
static void
-prepend_load_path (std::string dir)
+prepend_load_path (string dir)
{
- std::string s = "(set! %load-path (cons \"" + dir + "\" %load-path))";
+ string s = "(set! %load-path (cons \"" + dir + "\" %load-path))";
scm_c_eval_string (s.c_str ());
}
USER_NAME, GROUP_NAME, JAIL, DIR, JAIL_MAX
};
- std::vector<std::string> components = String_convert::split (jail_spec, ',');
+ vector<string> components = String_convert::split (jail_spec, ',');
if (components.size () != JAIL_MAX)
{
error (_f ("expected %d arguments with jail, found: %d", JAIL_MAX,
Disable localisation of float values. This breaks TeX output. */
setlocale (LC_NUMERIC, "C");
- std::string localedir = LOCALEDIR;
+ string localedir = LOCALEDIR;
if (char const *env = getenv ("LILYPOND_LOCALEDIR"))
localedir = env;
}
static void
-add_output_format (std::string format)
+add_output_format (string format)
{
if (output_format_global != "")
output_format_global += ",";
switch (opt->shortname_char_)
{
case 0:
- if (std::string (opt->longname_str0_) == "dvi"
- || std::string (opt->longname_str0_) == "pdf"
- || std::string (opt->longname_str0_) == "png"
- || std::string (opt->longname_str0_) == "ps"
- || std::string (opt->longname_str0_) == "tex")
+ if (string (opt->longname_str0_) == "dvi"
+ || string (opt->longname_str0_) == "pdf"
+ || string (opt->longname_str0_) == "png"
+ || string (opt->longname_str0_) == "ps"
+ || string (opt->longname_str0_) == "tex")
add_output_format (opt->longname_str0_);
- else if (std::string (opt->longname_str0_) == "preview")
+ else if (string (opt->longname_str0_) == "preview")
make_preview = true;
- else if (std::string (opt->longname_str0_) == "no-pages")
+ else if (string (opt->longname_str0_) == "no-pages")
make_print = false;
- else if (std::string (opt->longname_str0_) == "relocate")
+ else if (string (opt->longname_str0_) == "relocate")
relocate_binary = true;
break;
case 'd':
{
- std::string arg (option_parser->optional_argument_str0_);
+ string arg (option_parser->optional_argument_str0_);
ssize eq = arg.find ('=');
- std::string key = arg;
- std::string val = "#t";
+ string key = arg;
+ string val = "#t";
if (eq != NPOS)
{
break;
case 'o':
{
- std::string s = option_parser->optional_argument_str0_;
+ string s = option_parser->optional_argument_str0_;
File_name file_name (s);
output_name_global = file_name.to_string ();
}
extract_grob_set (me, "stems", stems);
- std::vector<Direction> dirs;
+ vector<Direction> dirs;
for (vsize i = 0; i < stems.size (); i++)
dirs.push_back (to_dir (stems[i]->get_property ("default-direction")));
protected:
virtual Spanner *create_ligature_spanner ();
- virtual void build_ligature (Spanner *ligature, std::vector<Grob_info> primitives);
+ virtual void build_ligature (Spanner *ligature, vector<Grob_info> primitives);
public:
TRANSLATOR_DECLARATIONS (Mensural_ligature_engraver);
private:
- void transform_heads (std::vector<Grob_info> primitives);
- void propagate_properties (Spanner *ligature, std::vector<Grob_info> primitives);
- void fold_up_primitives (std::vector<Grob_info> primitives);
+ void transform_heads (vector<Grob_info> primitives);
+ void propagate_properties (Spanner *ligature, vector<Grob_info> primitives);
+ void fold_up_primitives (vector<Grob_info> primitives);
};
Mensural_ligature_engraver::Mensural_ligature_engraver ()
}
void
-Mensural_ligature_engraver::transform_heads (std::vector<Grob_info> primitives)
+Mensural_ligature_engraver::transform_heads (vector<Grob_info> primitives)
{
if (primitives.size () < 2)
{
*/
void
Mensural_ligature_engraver::propagate_properties (Spanner *ligature,
- std::vector<Grob_info> primitives)
+ vector<Grob_info> primitives)
{
Real thickness
= robust_scm2double (ligature->get_property ("thickness"), 1.4);
}
void
-Mensural_ligature_engraver::fold_up_primitives (std::vector<Grob_info> primitives)
+Mensural_ligature_engraver::fold_up_primitives (vector<Grob_info> primitives)
{
Item *first = 0;
Real distance = 0;
void
Mensural_ligature_engraver::build_ligature (Spanner *ligature,
- std::vector<Grob_info> primitives)
+ vector<Grob_info> primitives)
{
transform_heads (primitives);
propagate_properties (ligature, primitives);
}
void
-Midi_chunk::set (std::string header_string, std::string data_string, std::string footer_string)
+Midi_chunk::set (string header_string, string data_string, string footer_string)
{
data_string_ = data_string;
footer_string_ = footer_string;
header_string_ = header_string;
}
-std::string
+string
Midi_chunk::data_string () const
{
return data_string_;
}
-std::string
+string
Midi_chunk::to_string () const
{
- std::string str = header_string_;
- std::string dat = data_string ();
- std::string length_string = String_convert::int2hex (dat.length ()
+ string str = header_string_;
+ string dat = data_string ();
+ string length_string = String_convert::int2hex (dat.length ()
+ footer_string_.length (), 8, '0');
length_string = String_convert::hex2bin (length_string);
seconds_ = seconds_f;
}
-std::string
+string
Midi_duration::to_string () const
{
- return std::string ("<duration: ") + std::to_string (seconds_) + ">";
+ return string ("<duration: ") + ::to_string (seconds_) + ">";
}
Midi_event::Midi_event (Moment delta_mom, Midi_item *midi)
/*
ugh. midi output badly broken since grace note hackage.
*/
-std::string
+string
Midi_event::to_string () const
{
Rational rat_dt = (delta_mom_.main_part_ * Rational (384)
+ delta_mom_.grace_part_ * Rational (100)) * Rational (4);
int delta_i = rat_dt.to_int ();
- std::string delta_string = Midi_item::i2varint_string (delta_i);
- std::string midi_string = midi_->to_string ();
+ string delta_string = Midi_item::i2varint_string (delta_i);
+ string midi_string = midi_->to_string ();
assert (midi_string.length ());
return delta_string + midi_string;
}
Midi_header::Midi_header (int format_i, int tracks_i, int clocks_per_4_i)
{
- std::string str;
+ string str;
- std::string format_string = String_convert::int2hex (format_i, 4, '0');
+ string format_string = String_convert::int2hex (format_i, 4, '0');
str += String_convert::hex2bin (format_string);
- std::string tracks_string = String_convert::int2hex (tracks_i, 4, '0');
+ string tracks_string = String_convert::int2hex (tracks_i, 4, '0');
str += String_convert::hex2bin (tracks_string);
- std::string tempo_string = String_convert::int2hex (clocks_per_4_i, 4, '0');
+ string tempo_string = String_convert::int2hex (clocks_per_4_i, 4, '0');
str += String_convert::hex2bin (tempo_string);
set ("MThd", str, "");
audio_->str_ = String_convert::to_lower (audio_->str_);
}
-std::string
+string
Midi_instrument::to_string () const
{
Byte program_byte = 0;
else
warning (_f ("no such MIDI instrument: `%s'", audio_->str_.c_str ()));
- std::string str = std::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME : Should be track. -rz
- str += std::to_string ((char)program_byte);
+ string str = ::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME : Should be track. -rz
+ str += ::to_string ((char)program_byte);
return str;
}
{
}
-std::string
+string
Midi_item::i2varint_string (int i)
{
int buffer_i = i & 0x7f;
buffer_i += (i & 0x7f);
}
- std::string str;
+ string str;
while (1)
{
- str += std::to_string ((char)buffer_i);
+ str += ::to_string ((char)buffer_i);
if (buffer_i & 0x80)
buffer_i >>= 8;
else
audio_ = a;
}
-std::string
+string
Midi_key::to_string () const
{
- std::string str = "ff5902";
+ string str = "ff5902";
str += String_convert::int2hex (audio_->accidentals_, 2, '0');
if (audio_->major_)
str += String_convert::int2hex (0, 2, '0');
clocks_per_1_ = 18;
}
-std::string
+string
Midi_time_signature::to_string () const
{
int num = abs (audio_->beats_);
- std::string str = "ff5804";
+ string str = "ff5804";
str += String_convert::int2hex (num, 2, '0');
str += String_convert::int2hex (intlog2 (den), 2, '0');
str += String_convert::int2hex (clocks_per_1_, 2, '0');
return p;
}
-std::string
+string
Midi_note::to_string () const
{
Byte status_byte = (char) (0x90 + channel_);
- std::string str = "";
+ string str = "";
int finetune;
// print warning if fine tuning was needed, HJJ
// The pitch wheel range (of 4 semitones) is multiplied by the cents.
finetune += (PITCH_WHEEL_RANGE *get_fine_tuning ()) / (4 * 100);
- str += std::to_string ((char) (0xE0 + channel_));
- str += std::to_string ((char) (finetune & 0x7F));
- str += std::to_string ((char) (finetune >> 7));
- str += std::to_string ((char) (0x00));
+ str += ::to_string ((char) (0xE0 + channel_));
+ str += ::to_string ((char) (finetune & 0x7F));
+ str += ::to_string ((char) (finetune >> 7));
+ str += ::to_string ((char) (0x00));
}
- str += std::to_string ((char)status_byte);
- str += std::to_string ((char) (get_pitch () + c0_pitch_i_));
- str += std::to_string ((char)dynamic_byte_);
+ str += ::to_string ((char)status_byte);
+ str += ::to_string ((char) (get_pitch () + c0_pitch_i_));
+ str += ::to_string ((char)dynamic_byte_);
return str;
}
aftertouch_byte_ = 64;
}
-std::string
+string
Midi_note_off::to_string () const
{
Byte status_byte = (char) (0x80 + channel_);
- std::string str = std::to_string ((char)status_byte);
- str += std::to_string ((char) (get_pitch () + Midi_note::c0_pitch_i_));
- str += std::to_string ((char)aftertouch_byte_);
+ string str = ::to_string ((char)status_byte);
+ str += ::to_string ((char) (get_pitch () + Midi_note::c0_pitch_i_));
+ str += ::to_string ((char)aftertouch_byte_);
if (get_fine_tuning () != 0)
{
// Move pitch wheel back to the central position.
- str += std::to_string ((char) 0x00);
- str += std::to_string ((char) (0xE0 + channel_));
- str += std::to_string ((char) (PITCH_WHEEL_CENTER &0x7F));
- str += std::to_string ((char) (PITCH_WHEEL_CENTER >> 7));
+ str += ::to_string ((char) 0x00);
+ str += ::to_string ((char) (0xE0 + channel_));
+ str += ::to_string ((char) (PITCH_WHEEL_CENTER &0x7F));
+ str += ::to_string ((char) (PITCH_WHEEL_CENTER >> 7));
}
return str;
audio_ = a;
}
-std::string
+string
Midi_dynamic::to_string () const
{
Byte status_byte = (char) (0xB0 + channel_);
- std::string str = std::to_string ((char)status_byte);
+ string str = ::to_string ((char)status_byte);
/*
Main volume controller (per channel):
if (volume > full_scale)
volume = (int)full_scale;
- str += std::to_string ((char)0x07);
- str += std::to_string ((char)volume);
+ str += ::to_string ((char)0x07);
+ str += ::to_string ((char)volume);
return str;
}
audio_ = a;
}
-std::string
+string
Midi_piano_pedal::to_string () const
{
Byte status_byte = (char) (0xB0 + channel_);
- std::string str = std::to_string ((char)status_byte);
+ string str = ::to_string ((char)status_byte);
if (audio_->type_string_ == "Sostenuto")
- str += std::to_string ((char)0x42);
+ str += ::to_string ((char)0x42);
else if (audio_->type_string_ == "Sustain")
- str += std::to_string ((char)0x40);
+ str += ::to_string ((char)0x40);
else if (audio_->type_string_ == "UnaCorda")
- str += std::to_string ((char)0x43);
+ str += ::to_string ((char)0x43);
int pedal = ((1 - audio_->dir_) / 2) * 0x7f;
- str += std::to_string ((char)pedal);
+ str += ::to_string ((char)pedal);
return str;
}
audio_ = a;
}
-std::string
+string
Midi_tempo::to_string () const
{
int useconds_per_4_i = 60 * (int)1e6 / audio_->per_minute_4_;
- std::string str = "ff5103";
+ string str = "ff5103";
str += String_convert::int2hex (useconds_per_4_i, 6, '0');
return String_convert::hex2bin (str);
}
audio_ = a;
}
-std::string
+string
Midi_text::to_string () const
{
- std::string str = "ff" + String_convert::int2hex (audio_->type_, 2, '0');
+ string str = "ff" + String_convert::int2hex (audio_->type_, 2, '0');
str = String_convert::hex2bin (str);
str += i2varint_string (audio_->text_string_.length ());
str += audio_->text_string_;
// "00" "ff59" "02" "ff" "00"
;
- std::string data_string;
+ string data_string;
// only for format 0 (currently using format 1)?
data_string += String_convert::hex2bin (data_str0);
char const *footer_str0 = "00" "ff2f" "00";
- std::string footer_string = String_convert::hex2bin (footer_str0);
+ string footer_string = String_convert::hex2bin (footer_str0);
set ("MTrk", data_string, footer_string);
}
event_p_list_.append (new Killing_cons<Midi_event> (e, 0));
}
-std::string
+string
Midi_track::data_string () const
{
- std::string str = Midi_chunk::data_string ();
+ string str = Midi_chunk::data_string ();
if (do_midi_debugging_global)
str += "\n";
for (Cons<Midi_event> *i = event_p_list_.head_; i; i = i->next_)
#include "string-convert.hh"
#include "warn.hh"
-Midi_stream::Midi_stream (std::string file_name)
+Midi_stream::Midi_stream (string file_name)
{
file_name_string_ = file_name;
out_file_ = fopen (file_name.c_str (), "wb");
}
Midi_stream &
-Midi_stream::operator << (std::string str)
+Midi_stream::operator << (string str)
{
size_t sz = sizeof (Byte);
size_t n = str.length ();
Midi_stream &
Midi_stream::operator << (Midi_item const &midi_c_r)
{
- std::string str = midi_c_r.to_string ();
+ string str = midi_c_r.to_string ();
// ugh, should have separate debugging output with Midi*::print routines
if (do_midi_debugging_global)
return log (x) / log (2.0);
}
-std::vector<std::string>
-split_string (std::string s, char c)
+vector<string>
+split_string (string s, char c)
{
- std::vector<std::string> rv;
+ vector<string> rv;
while (s.length ())
{
ssize i = s.find (c);
}
Offset
-Modified_font_metric::attachment_point (std::string s) const
+Modified_font_metric::attachment_point (string s) const
{
Offset o = orig_->attachment_point (s);
return o * magnification_;
}
vsize
-Modified_font_metric::name_to_index (std::string s) const
+Modified_font_metric::name_to_index (string s) const
{
return orig_->name_to_index (s);
}
/* TODO: put this klutchness behind ly:option switch. */
Box
-Modified_font_metric::tex_kludge (std::string text) const
+Modified_font_metric::tex_kludge (string text) const
{
Interval ydims;
Real w = 0;
}
Stencil
-Modified_font_metric::text_stencil (std::string text) const
+Modified_font_metric::text_stencil (string text) const
{
Box b;
if (Pango_font *pf = dynamic_cast<Pango_font *> (orig_))
}
Box
-Modified_font_metric::text_dimension (std::string text) const
+Modified_font_metric::text_dimension (string text) const
{
SCM stext = scm_makfrom0str (text.c_str ());
Box b = lookup_tex_text_dimension (orig_, stext);
return orig_->sub_fonts ();
}
-std::string
+string
Modified_font_metric::font_name () const
{
return original_font ()->font_name ();
Moment *r = (Moment *) SCM_CELL_WORD_1 (s);
scm_puts ("#<Mom ", port);
- std::string str = r->to_string ();
+ string str = r->to_string ();
scm_puts ((char *)str.c_str (), port);
scm_puts (">", port);
main_part_.set_infinite (k);
}
-std::string
+string
Moment::to_string () const
{
- std::string s = main_part_.to_string ();
+ string s = main_part_.to_string ();
if (grace_part_)
s += "G" + grace_part_.to_string ();
return s;
private:
Music *rest_ev_;
- Link_array__Music_ text_events_;
+ vector<Music*> text_events_;
int start_measure_;
Rational last_main_moment_;
Moment stop_moment_;
Spanner *last_rest_;
Spanner *mmrest_;
- Link_array__Spanner_ numbers_;
- Link_array__Spanner_ last_numbers_;
+ vector<Spanner*> numbers_;
+ vector<Spanner*> last_numbers_;
};
Multi_measure_rest_engraver::Multi_measure_rest_engraver ()
{
extern SCM ly_music_p_proc;
- std::string str = "";
+ string str = "";
for (SCM s = signature; scm_is_pair (s); s = scm_cdr (s))
{
if (str != "")
class New_fingering_engraver : public Engraver
{
- std::vector<Finger_tuple> fingerings_;
- std::vector<Finger_tuple> articulations_;
- std::vector<Finger_tuple> string_numbers_;
+ vector<Finger_tuple> fingerings_;
+ vector<Finger_tuple> articulations_;
+ vector<Finger_tuple> string_numbers_;
- Link_array__Grob_ heads_;
+ vector<Grob*> heads_;
Grob *stem_;
public:
void add_fingering (Grob *, Music *, Music *);
void add_script (Grob *, Music *, Music *);
void add_string (Grob *, Music *, Music *);
- void position_scripts (SCM orientations, std::vector<Finger_tuple> *);
+ void position_scripts (SCM orientations, vector<Finger_tuple> *);
};
void
void
New_fingering_engraver::position_scripts (SCM orientations,
- std::vector<Finger_tuple> *scripts)
+ vector<Finger_tuple> *scripts)
{
for (vsize i = 0; i < scripts->size (); i++)
if (stem_ && to_boolean (scripts->at (i).script_->get_property ("add-stem-support")))
for (vsize j = heads_.size (); j--;)
Side_position_interface::add_support ((*scripts)[i].script_, heads_[j]);
- std::vector<Finger_tuple> up, down, horiz;
+ vector<Finger_tuple> up, down, horiz;
for (vsize i = scripts->size (); i--;)
{
SCM d = (*scripts)[i].finger_event_->get_property ("direction");
int finger_prio = 200;
Direction d = DOWN;
- Drul_array< std::vector<Finger_tuple> > vertical (down, up);
+ Drul_array< vector<Finger_tuple> > vertical (down, up);
do
{
for (vsize i = 0; i < vertical[d].size (); i++)
while (t && t->get_parent_context ())
t = t->get_parent_context ();
- std::string name = ly_scm2string (voice_name);
+ string name = ly_scm2string (voice_name);
Context *voice = find_context_below (t, ly_symbol2scm ("Voice"), name);
if (voice)
{
SCM voice_name = get_music ()->get_property ("associated-context");
- std::string name;
+ string name;
if (scm_is_string (voice_name))
name = ly_scm2string (voice_name);
void
check_meshing_chords (Grob *me,
- Drul_array<std::vector<Real> > *offsets,
- Drul_array<std::vector<Slice> > const &extents,
- Drul_array<Link_array__Grob_ > const &clash_groups)
+ Drul_array<vector<Real> > *offsets,
+ Drul_array<vector<Slice> > const &extents,
+ Drul_array<vector<Grob*> > const &clash_groups)
{
if (!extents[UP].size () || ! extents[DOWN].size ())
Grob *nu = Note_column::first_head (cu);
Grob *nd = Note_column::first_head (cd);
- std::vector<int> ups = Stem::note_head_positions (Note_column::get_stem (cu));
- std::vector<int> dps = Stem::note_head_positions (Note_column::get_stem (cd));
+ vector<int> ups = Stem::note_head_positions (Note_column::get_stem (cu));
+ vector<int> dps = Stem::note_head_positions (Note_column::get_stem (cd));
/* Too far apart to collide. */
if (ups[0] > dps.back () + 1)
Note_collision_interface::calc_positioning_done (SCM smob)
{
Grob *me = unsmob_grob (smob);
- Drul_array<Link_array__Grob_ > cg = get_clash_groups (me);
+ Drul_array<vector<Grob*> > cg = get_clash_groups (me);
Direction d = UP;
do
}
while (flip (&d) != UP);
- Link_array__Grob_ done;
+ vector<Grob*> done;
Real left_most = 1e6;
- std::vector<Real> amounts;
+ vector<Real> amounts;
for (; scm_is_pair (hand); hand = scm_cdr (hand))
{
Grob *s = unsmob_grob (scm_caar (hand));
return SCM_BOOL_T;
}
-Drul_array < Link_array__Grob_ >
+Drul_array < vector<Grob*> >
Note_collision_interface::get_clash_groups (Grob *me)
{
- Drul_array<Link_array__Grob_ > clash_groups;
+ Drul_array<vector<Grob*> > clash_groups;
extract_grob_set (me, "elements", elements);
for (vsize i = 0; i < elements.size (); i++)
Direction d = UP;
do
{
- Link_array__Grob_ &clashes (clash_groups[d]);
+ vector<Grob*> &clashes (clash_groups[d]);
vector_sort (clashes, Note_column::shift_compare);
}
while ((flip (&d)) != UP);
*/
SCM
Note_collision_interface::automatic_shift (Grob *me,
- Drul_array < Link_array__Grob_
+ Drul_array < vector<Grob*>
> clash_groups)
{
- Drul_array < std::vector<int> > shifts;
+ Drul_array < vector<int> > shifts;
SCM tups = SCM_EOL;
Direction d = UP;
do
{
- std::vector<int> &shift (shifts[d]);
- Link_array__Grob_ &clashes (clash_groups[d]);
+ vector<int> &shift (shifts[d]);
+ vector<Grob*> &clashes (clash_groups[d]);
for (vsize i = 0; i < clashes.size (); i++)
{
}
while ((flip (&d)) != UP);
- Drul_array<std::vector<Slice> > extents;
- Drul_array<std::vector<Real> > offsets;
+ Drul_array<vector<Slice> > extents;
+ Drul_array<vector<Real> > offsets;
d = UP;
do
{
clean up the mess left by ledger line handling.
*/
static Stencil
-internal_print (Grob *me, std::string *font_char)
+internal_print (Grob *me, string *font_char)
{
SCM style = me->get_property ("style");
if (!scm_is_symbol (style))
style = ly_symbol2scm ("default");
- std::string suffix = to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2));
+ string suffix = to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2));
if (style != ly_symbol2scm ("default"))
{
SCM gn = me->get_property ("glyph-name");
Font_metric *fm = Font_interface::get_default_font (me);
- std::string idx = "noteheads.s" + suffix;
+ string idx = "noteheads.s" + suffix;
Stencil out = fm->find_by_name (idx);
if (out.is_empty ())
{
- std::string prefix = "noteheads.";
+ string prefix = "noteheads.";
Grob *stem = unsmob_grob (me->get_object ("stem"));
Direction stem_dir = stem ? get_grob_direction (stem) : CENTER;
{
Grob *me = unsmob_grob (smob);
- std::string idx;
+ string idx;
return internal_print (me, &idx).smobbed_copy ();
}
{
Grob *me = unsmob_grob (smob);
Font_metric *fm = Font_interface::get_default_font (me);
- std::string key;
+ string key;
internal_print (me, &key);
Offset att;
class Note_heads_engraver : public Engraver
{
- Link_array__Item_ notes_;
- Link_array__Item_ dots_;
- Link_array__Music_ note_evs_;
+ vector<Item*> notes_;
+ vector<Item*> dots_;
+ vector<Music*> note_evs_;
public:
TRANSLATOR_DECLARATIONS (Note_heads_engraver);
public:
TRANSLATOR_DECLARATIONS (Note_name_engraver);
- Link_array__Music_ events_;
- Link_array__Item_ texts_;
+ vector<Music*> events_;
+ vector<Item*> texts_;
virtual bool try_music (Music *m);
void process_music ();
void stop_translation_timestep ();
void
Note_name_engraver::process_music ()
{
- std::string s;
+ string s;
for (vsize i = 0; i < events_.size (); i++)
{
if (i)
void process_music ();
private:
- Link_array__Music_ note_evs_;
- Link_array__Audio_note_ notes_;
+ vector<Music*> note_evs_;
+ vector<Audio_note*> notes_;
};
void
Interval left_head_wid;
do
{
- Link_array__Grob_ const &items (ly_scm2link_array (props [d]));
+ vector<Grob*> const &items (ly_scm2link_array (props [d]));
for (vsize i = items.size (); i--;)
{
Item *it = dynamic_cast<Item *> (items[i]);
if (prune && a)
{
- Link_array__Grob_ &right = a->array_reference ();
+ vector<Grob*> &right = a->array_reference ();
for (vsize i = right.size (); i--;)
{
if (dynamic_cast<Item *> (right[i])->get_column () != mincol)
do
{
- Link_array__Grob_ const &items (ly_scm2link_array (props [d]));
+ vector<Grob*> const &items (ly_scm2link_array (props [d]));
for (vsize i = 0; i < items.size (); i++)
{
Item *it = dynamic_cast<Item *> (items[i]);
char ctag [5] = " ";
- std::string tag_string = ly_scm2string (tag);
+ string tag_string = ly_scm2string (tag);
strncpy (ctag, tag_string.c_str (), tag_string.length ());
- std::string tab = otf->get_otf_table (std::string (ctag));
+ string tab = otf->get_otf_table (string (ctag));
return scm_from_locale_stringn ((char const *) tab.data (), tab.length ());
}
return 0;
}
-std::string
-Open_type_font::get_otf_table (std::string tag) const
+string
+Open_type_font::get_otf_table (string tag) const
{
return ::get_otf_table (face_, tag);
}
SCM tab = SCM_EOL;
if (buffer)
{
- std::string contents ((char const*)buffer, length);
+ string contents ((char const*)buffer, length);
contents = "(quote (" + contents + "))";
tab = scm_c_eval_string (contents.c_str ());
/*
UGH fix naming
*/
-std::string
-get_otf_table (FT_Face face, std::string tag)
+string
+get_otf_table (FT_Face face, string tag)
{
FT_ULong len;
FT_Byte *tab = load_table (tag.c_str (), face, &len);
- return std::string ((char const*) tab, len);
+ return string ((char const*) tab, len);
}
FT_Face
-open_ft_face (std::string str)
+open_ft_face (string str)
{
FT_Face face;
int error_code = FT_New_Face (freetype2_library, str.c_str (), 0, &face);
}
SCM
-Open_type_font::make_otf (std::string str)
+Open_type_font::make_otf (string str)
{
FT_Face face = open_ft_face (str);
Open_type_font *otf = new Open_type_font (face);
}
Offset
-Open_type_font::attachment_point (std::string glyph_name) const
+Open_type_font::attachment_point (string glyph_name) const
{
SCM sym = ly_symbol2scm (glyph_name.c_str ());
SCM entry = scm_hashq_ref (lily_character_table_, sym, SCM_BOOL_F);
}
vsize
-Open_type_font::name_to_index (std::string nm) const
+Open_type_font::name_to_index (string nm) const
{
char *nm_str = (char *) nm.c_str ();
if (vsize idx = FT_Get_Name_Index (face_, nm_str))
return lily_global_table_;
}
-std::string
+string
Open_type_font::font_name () const
{
return FT_Get_Postscript_Name (face_);
}
SCM
-Output_def::c_variable (std::string s) const
+Output_def::c_variable (string s) const
{
return lookup_variable (ly_symbol2scm (s.c_str ()));
}
{
TRANSLATOR_DECLARATIONS (Output_property_engraver);
protected:
- Link_array__Music_ props_;
+ vector<Music*> props_;
DECLARE_ACKNOWLEDGER (grob)
void stop_translation_timestep ();
}
void
-Pango_font::register_font_file (std::string filename, std::string ps_name)
+Pango_font::register_font_file (string filename, string ps_name)
{
scm_hash_set_x (physical_font_tab_,
scm_makfrom0str (ps_name.c_str ()),
}
Stencil
-Pango_font::pango_item_string_stencil (PangoItem const *item, std::string str) const
+Pango_font::pango_item_string_stencil (PangoItem const *item, string str) const
{
const int GLYPH_NAME_LEN = 256;
char glyph_name[GLYPH_NAME_LEN];
char *file_name_as_ptr = 0;
FcPatternGetString (fcpat, FC_FILE, 0, (FcChar8 **) & file_name_as_ptr);
- std::string file_name;
+ string file_name;
if (file_name_as_ptr)
{
/* Normalize file name. */
if (!ps_name_str0)
warning (_f ("no PostScript font name for font `%s'", file_name));
- std::string ps_name;
+ string ps_name;
if (!ps_name_str0
&& file_name != ""
&& (file_name.find (".otf") != NPOS
{
/* UGH: kludge a PS name for OTF/CFF fonts. */
- std::string name = file_name;
+ string name = file_name;
ssize idx = file_name.find (".otf");
if (idx == NPOS)
idx = file_name.find (".cff");
name.length () - slash_idx);
}
- std::string initial = name.substr (0, 1);
+ string initial = name.substr (0, 1);
initial = String_convert::to_upper (initial);
name = name.substr (1, name.length () - 1);
name = String_convert::to_lower (name);
}
Stencil
-Pango_font::text_stencil (std::string str) const
+Pango_font::text_stencil (string str) const
{
GList *items
= pango_itemize (context_,
PangoFontDescription *description = 0;
if (scm_is_string (name))
{
- std::string name_str = ly_scm2string (name);
+ string name_str = ly_scm2string (name);
description = pango_font_description_from_string (name_str.c_str ());
}
else
{
PangoFontDescription *description = pango_font_description_new ();
- std::string family_str = "roman";
+ string family_str = "roman";
if (scm_is_symbol (family))
family_str = ly_symbol2string (family);
else if (scm_is_string (family))
if (ly_is_module (header_))
scopes = scm_cons (header_, scopes);
- std::string mod_nm = "scm framework-" + output_backend_global;
+ string mod_nm = "scm framework-" + output_backend_global;
SCM mod = scm_c_resolve_module (mod_nm.c_str ());
if (make_print)
if (ly_is_module (header_0_))
scopes = scm_cons (header_0_, scopes);
- std::string format = output_backend_global;
- std::string mod_nm = "scm framework-" + format;
+ string format = output_backend_global;
+ string mod_nm = "scm framework-" + format;
SCM mod = scm_c_resolve_module (mod_nm.c_str ());
SCM func = scm_c_module_lookup (mod, "output-classic-framework");
{
Grob *me = unsmob_grob (p);
- std::string r = to_string (Paper_column::get_rank (me));
+ string r = to_string (Paper_column::get_rank (me));
Moment *mom = unsmob_moment (me->get_property ("when"));
- std::string when = mom ? mom->to_string () : "?/?";
+ string when = mom ? mom->to_string () : "?/?";
SCM properties = Font_interface::text_font_alist_chain (me);
if (!ga)
return SCM_UNSPECIFIED;
- Link_array__Grob_ &array (ga->array_reference ());
+ vector<Grob*> &array (ga->array_reference ());
for (vsize i = array.size (); i--;)
{
SCM_ASSERT_TYPE (scm_is_string (format), format, SCM_ARG2, __FUNCTION__,
"String");
- std::string f = ly_scm2string (format);
+ string f = ly_scm2string (format);
- std::string output_name = "<unknown>";
+ string output_name = "<unknown>";
SCM port_name = scm_port_filename (port);
if (scm_is_string (port_name))
#include "ly-smobs.icc"
-Paper_outputter::Paper_outputter (SCM port, std::string format)
+Paper_outputter::Paper_outputter (SCM port, string format)
{
file_ = port;
output_module_ = SCM_EOL;
smobify_self ();
- std::string module_name = "scm output-" + format;
+ string module_name = "scm output-" + format;
output_module_ = scm_c_resolve_module (module_name.c_str ());
}
system->unprotect ();
}
-std::vector<Column_x_positions>
+vector<Column_x_positions>
Paper_score::calc_breaking ()
{
Break_algorithm *algorithm = 0;
- std::vector<Column_x_positions> sol;
+ vector<Column_x_positions> sol;
algorithm = new Gourlay_breaking;
algorithm->set_pscore (this);
down the road.
doubly, also done in Score_engraver */
- Link_array__Grob_ pc (system_->columns ());
+ vector<Grob*> pc (system_->columns ());
pc[0]->set_property ("breakable", SCM_BOOL_T);
pc.back ()->set_property ("breakable", SCM_BOOL_T);
system_->pre_processing ();
- std::vector<Column_x_positions> breaking = calc_breaking ();
+ vector<Column_x_positions> breaking = calc_breaking ();
system_->break_into_pieces (breaking);
paper_systems_ = system_->get_paper_systems ();
bool
is_regular_identifier (SCM id)
{
- std::string str = ly_scm2string (id);
+ string str = ly_scm2string (id);
char const *s = str.c_str ();
bool v = true;
solo2 ();
else if (scm_is_symbol (tag))
{
- std::string s = "Unknown split directive: "
- + (scm_is_symbol (tag) ? ly_symbol2string (tag) : std::string ("not a symbol"));
+ string s = "Unknown split directive: "
+ + (scm_is_symbol (tag) ? ly_symbol2string (tag) : string ("not a symbol"));
programming_error (s);
}
}
midi_track.channel_ = 9;
// perhaps multiple text events?
- std::string id_string;
- std::string str = std::string (_ ("Creator: "));
+ string id_string;
+ string str = string (_ ("Creator: "));
id_string = String_convert::pad_to (gnu_lilypond_version_string (), 30);
str += id_string;
}
void
-Performance::write_output (std::string out)
+Performance::write_output (string out)
{
if (out == "-")
out = "lelie.midi";
SCM_ASSERT_TYPE (scm_is_string (pfb_file_name), pfb_file_name,
SCM_ARG1, __FUNCTION__, "string");
- std::string file_name = ly_scm2string (pfb_file_name);
+ string file_name = ly_scm2string (pfb_file_name);
int len = -1;
if (be_verbose_global)
SCM_ASSERT_TYPE (scm_is_string (otf_file_name), otf_file_name,
SCM_ARG1, __FUNCTION__, "string");
- std::string file_name = ly_scm2string (otf_file_name);
+ string file_name = ly_scm2string (otf_file_name);
if (be_verbose_global)
progress_indication ("[" + file_name);
FT_Face face = open_ft_face (file_name);
- std::string table = get_otf_table (face, "CFF ");
+ string table = get_otf_table (face, "CFF ");
SCM asscm = scm_from_locale_stringn ((char *) table.data (),
table.length ());
{
Drul_array<Music *> events_;
Music *running_slur_start_;
- Link_array__Grob_ slurs_;
- Link_array__Grob_ end_slurs_;
+ vector<Grob*> slurs_;
+ vector<Grob*> end_slurs_;
protected:
virtual bool try_music (Music *);
occurs simultaneously then extra space can be added between them.
*/
- Link_array__Spanner_ previous_;
+ vector<Spanner*> previous_;
void del_linespanner (Spanner *);
void create_text_grobs (Pedal_info *p, bool);
{
for (Pedal_info *p = info_list_; p->name_; p++)
{
- std::string nm = p->name_ + std::string ("Event");
+ string nm = p->name_ + string ("Event");
if (ly_is_equal (m->get_property ("name"),
scm_str2symbol (nm.c_str ())))
{
{
if (!p->line_spanner_)
{
- std::string name = std::string (p->name_) + "PedalLineSpanner";
+ string name = string (p->name_) + "PedalLineSpanner";
Music *rq = (p->event_drul_[START] ? p->event_drul_[START] : p->event_drul_[STOP]);
p->line_spanner_ = make_spanner (name.c_str (), rq->self_scm ());
}
mixed: Ped. _____/\____|
*/
- std::string prop = std::string ("pedal") + p->name_ + "Style";
+ string prop = string ("pedal") + p->name_ + "Style";
SCM style = get_property (prop.c_str ());
bool mixed = style == ly_symbol2scm ("mixed");
Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed)
{
SCM s = SCM_EOL;
- SCM strings = get_property (("pedal" + std::string (p->name_) + "Strings").c_str ());
+ SCM strings = get_property (("pedal" + string (p->name_) + "Strings").c_str ());
if (scm_ilength (strings) < 3)
{
Music *m = p->event_drul_[START];
if (!m) m = p->event_drul_ [STOP];
- std::string msg = _f ("expect 3 strings for piano pedals, found: %d",
+ string msg = _f ("expect 3 strings for piano pedals, found: %d",
scm_ilength (strings));
if (m)
m->origin ()->warning (msg);
if (scm_is_string (s))
{
- std::string propname = std::string (p->name_) + "Pedal";
+ string propname = string (p->name_) + "Pedal";
p->item_ = make_item (propname.c_str (), (p->event_drul_[START]
? p->event_drul_[START]
{
if (!p->bracket_ && p->event_drul_[STOP])
{
- std::string msg = _f ("can't find start of piano pedal bracket: `%s'", p->name_);
+ string msg = _f ("can't find start of piano pedal bracket: `%s'", p->name_);
p->event_drul_[STOP]->origin ()->warning (msg);
p->event_drul_[STOP] = 0;
}
void start_translation_timestep ();
private:
- Link_array__Audio_piano_pedal_ audios_;
+ vector<Audio_piano_pedal*> audios_;
Pedal_info *info_alist_;
};
if (p->event_drul_[STOP])
{
if (!p->start_event_)
- p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", std::string (p->name_)));
+ p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", string (p->name_)));
else
{
Audio_piano_pedal *a = new Audio_piano_pedal;
- a->type_string_ = std::string (p->name_);
+ a->type_string_ = string (p->name_);
a->dir_ = STOP;
audios_.push_back (a);
Audio_element_info info(a, p->event_drul_[STOP]);
{
p->start_event_ = p->event_drul_[START];
Audio_piano_pedal *a = new Audio_piano_pedal;
- a->type_string_ = std::string (p->name_);
+ a->type_string_ = string (p->name_);
a->dir_ = START;
audios_.push_back (a);
Audio_element_info info(a, p->event_drul_[START]);
{
for (Pedal_info *p = info_alist_; p->name_; p++)
{
- std::string nm = p->name_ + std::string ("Event");
+ string nm = p->name_ + string ("Event");
if (ly_is_equal (r->get_property ("name"),
scm_str2symbol (nm.c_str ())))
{
char const *accname[] = {"eses", "eseh", "es", "eh", "",
"ih", "is", "isih", "isis"};
-std::string
+string
Pitch::to_string () const
{
int n = (notename_ + 2) % 7;
- std::string s = std::to_string (char (n + 'a'));
+ string s = ::to_string (char (n + 'a'));
if (alteration_)
- s += std::string (accname[alteration_ - DOUBLE_FLAT]);
+ s += string (accname[alteration_ - DOUBLE_FLAT]);
if (octave_ >= 0)
{
{
int o = (-octave_) - 1;
while (o--)
- s += std::to_string (',');
+ s += ::to_string (',');
}
return s;
Item *trill_group_;
Item *trill_accidental_;
- Link_array__Grob_ heads_;
+ vector<Grob*> heads_;
void make_trill (Music *);
};
arr->add (p);
}
-static Link_array__Grob_ empty_array;
+static vector<Grob*> empty_array;
-Link_array__Grob_ const &
+vector<Grob*> const &
ly_scm2link_array (SCM x)
{
Grob_array *arr = unsmob_grob_array (x);
return arr ? arr->array () : empty_array;
}
-Link_array__Grob_ const &
+vector<Grob*> const &
internal_extract_grob_array (Grob const *elt, SCM symbol)
{
return ly_scm2link_array (elt->internal_get_object (symbol));
}
-Link_array__Item_
+vector<Item*>
internal_extract_item_array (Grob const *elt, SCM symbol)
{
Grob_array *arr = unsmob_grob_array (elt->internal_get_object (symbol));
- Link_array__Item_ items;
+ vector<Item*> items;
for (vsize i = 0; arr && i < arr->size (); i++)
items.push_back (arr->item (i));
return (m) ? mutable_property_alist_ : immutable_property_alist_;
}
-std::string
+string
Prob::name () const
{
SCM nm = get_property ("name");
/*
Hmmm. should do in SCM / C++ ?
*/
-static std::string
+static string
get_help_string ()
{
SCM alist = ly_hash2alist (option_hash);
SCM convertor = ly_lily_module_constant ("scm->string");
- std::vector<std::string> opts;
+ vector<string> opts;
for (SCM s = alist; scm_is_pair (s); s = scm_cdr (s))
{
SCM sym = scm_caar (s);
SCM val = scm_cdar (s);
- std::string opt_spec
+ string opt_spec
= String_convert::char_string (' ', INDENT)
+ ly_symbol2string (sym)
+ " ("
SCM opt_help_scm
= scm_object_property (sym, ly_symbol2scm ("program-option-documentation"));
- std::string opt_help = ly_scm2string (opt_help_scm);
+ string opt_help = ly_scm2string (opt_help_scm);
replace_all (opt_help,
- std::string ("\n"),
- std::string ("\n")
+ string ("\n"),
+ string ("\n")
+ String_convert::char_string (' ', HELP_INDENT));
opts.push_back (opt_spec + opt_help + "\n");
}
- std::string help ("Options supported by ly:set-option\n\n");
+ string help ("Options supported by ly:set-option\n\n");
vector_sort (opts, string_compare);
for (vsize i = 0; i < opts.size (); i++)
help += opts[i];
- help += std::string ("\n");
+ help += string ("\n");
return help;
}
LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (),
"Print ly:set-option usage")
{
- std::string help = get_help_string ();
+ string help = get_help_string ();
fputs (help.c_str (), stdout);
exit (0);
if (val == SCM_UNDEFINED)
val = SCM_BOOL_T;
- std::string varstr = ly_scm2string (scm_symbol_to_string (var));
- if (varstr.substr (0, 3) == std::string ("no-"))
+ string varstr = ly_scm2string (scm_symbol_to_string (var));
+ if (varstr.substr (0, 3) == string ("no-"))
{
var = ly_symbol2scm (varstr.substr (3, varstr.length () -3).c_str ());
val = scm_from_bool (!to_boolean (val));
if (result != *check_p)
{
- std::string s = _ ("Failed octave check, got: ");
+ string s = _ ("Failed octave check, got: ");
s += result.to_string ();
m->origin ()->warning (s);
int
-sane_putenv (char const *key, std::string value, bool overwrite)
+sane_putenv (char const *key, string value, bool overwrite)
{
if (overwrite || !getenv (key))
{
- std::string combine = std::string (key) + "=" + value;
+ string combine = string (key) + "=" + value;
char *s = strdup (combine.c_str ());
return putenv (s);
}
}
static int
-set_env_file (char const *key, std::string value, bool overwrite = false)
+set_env_file (char const *key, string value, bool overwrite = false)
{
if (is_file (value))
return sane_putenv (key, value, overwrite);
}
static int
-set_env_dir (char const *key, std::string value)
+set_env_dir (char const *key, string value)
{
if (is_dir (value))
return sane_putenv (key, value, false);
}
static int
-prepend_env_path (char const *key, std::string value)
+prepend_env_path (char const *key, string value)
{
if (is_dir (value))
{
return -1;
}
-std::string
-dir_name (std::string const file_name)
+string
+dir_name (string const file_name)
{
- std::string s = file_name;
+ string s = file_name;
replace_all (s, '\\', '/');
ssize n = s.length ();
if (n && s[n - 1] == '/')
#endif
void
-prefix_relocation (std::string prefix)
+prefix_relocation (string prefix)
{
if (be_verbose_global)
warning (_f ("Relocation: compile prefix=%s, new prefix=%s",
prefix_directory,
prefix.c_str ()));
- std::string bindir = prefix + "/bin";
- std::string datadir = prefix + "/share";
- std::string localedir = datadir + "/locale";
- std::string lilypond_datadir = datadir + "/lilypond/";
+ string bindir = prefix + "/bin";
+ string datadir = prefix + "/share";
+ string localedir = datadir + "/locale";
+ string lilypond_datadir = datadir + "/lilypond/";
if (is_dir (lilypond_datadir + "/" + TOPLEVEL_VERSION))
prefix_directory = lilypond_datadir + "/" + TOPLEVEL_VERSION;
}
void
-framework_relocation (std::string prefix)
+framework_relocation (string prefix)
{
if (be_verbose_global)
warning (_f ("Relocation: framework_prefix=%s", prefix));
- std::string bindir = prefix + "/bin";
- std::string datadir = prefix + "/share";
- std::string libdir = prefix + "/lib";
- std::string sysconfdir = prefix + "/etc";
+ string bindir = prefix + "/bin";
+ string datadir = prefix + "/share";
+ string libdir = prefix + "/lib";
+ string sysconfdir = prefix + "/etc";
/* need otherwise dynamic .so's aren't found. */
prepend_env_path ("DYLD_LIBRARY_PATH", libdir);
prepend_env_path ("PATH", bindir);
}
-std::string
+string
get_working_directory ()
{
char cwd[PATH_MAX];
getcwd (cwd, PATH_MAX);
- return std::string (cwd);
+ return string (cwd);
}
void
if (relocate_binary
&& getenv ("LILYPOND_RELOCATE_PREFIX"))
{
- std::string prefix = getenv ("LILYPOND_RELOCATE_PREFIX");
+ string prefix = getenv ("LILYPOND_RELOCATE_PREFIX");
#ifdef __MINGW32__
/* Normalize file name. */
prefix = File_name (prefix).to_string ();
#endif /* __MINGW32__ */
prefix_relocation (prefix);
- std::string bindir = prefix + "/bin";
+ string bindir = prefix + "/bin";
framework_relocation (bindir + "/" FRAMEWORKDIR);
}
else if (relocate_binary)
{
- std::string argv0_abs;
+ string argv0_abs;
if (argv0_filename.is_absolute ())
{
argv0_abs = argv0_filename.to_string ();
else if (argv0_filename.dir_.length ())
{
argv0_abs = get_working_directory ()
- + "/" + std::string (argv0_filename.to_string ());
+ + "/" + string (argv0_filename.to_string ());
if (be_verbose_global)
warning (_f ("Relocation: from cwd: argv0=%s", argv0_ptr));
}
programming_error ("can't find absolute argv0.");
}
- std::string bindir = dir_name (argv0_abs);
- std::string argv0_prefix = dir_name (bindir);
- std::string compile_prefix = dir_name (dir_name (dir_name (prefix_directory)));
+ string bindir = dir_name (argv0_abs);
+ string argv0_prefix = dir_name (bindir);
+ string compile_prefix = dir_name (dir_name (dir_name (prefix_directory)));
if (argv0_prefix != compile_prefix)
prefix_relocation (argv0_prefix);
- if (argv0_prefix != compile_prefix || std::string (FRAMEWORKDIR) != "..")
+ if (argv0_prefix != compile_prefix || string (FRAMEWORKDIR) != "..")
framework_relocation (bindir + "/" FRAMEWORKDIR);
}
*/
struct stat statbuf;
- std::string build_prefix_current = prefix_directory + "/share/lilypond/" "current";
- std::string build_prefix_version = prefix_directory + "/share/lilypond/" TOPLEVEL_VERSION;
+ string build_prefix_current = prefix_directory + "/share/lilypond/" "current";
+ string build_prefix_version = prefix_directory + "/share/lilypond/" TOPLEVEL_VERSION;
if (stat (build_prefix_version.c_str (), &statbuf) == 0)
prefix_directory = build_prefix_version;
else if (stat (build_prefix_current.c_str (), &statbuf) == 0)
char *suffixes[] = {"ly", "ps", "scm", 0 };
- std::vector<std::string> dirs;
+ vector<string> dirs;
for (char **s = suffixes; *s; s++)
{
- std::string path = prefix_directory + to_string ('/') + std::string (*s);
+ string path = prefix_directory + to_string ('/') + string (*s);
dirs.push_back (path);
}
SCM cs = get_property ("repeatCommands");
- std::string s = "";
+ string s = "";
bool start = false;
bool end = false;
bool volta_found = false;
{
Item *rest_collision_;
vsize rest_count_;
- Link_array__Grob_ note_columns_;
+ vector<Grob*> note_columns_;
protected:
DECLARE_ACKNOWLEDGER (note_column);
void process_acknowledged ();
Grob *me = unsmob_grob (smob);
extract_grob_set (me, "elements", elts);
- Link_array__Grob_ rests;
- Link_array__Grob_ notes;
+ vector<Grob*> rests;
+ vector<Grob*> notes;
for (vsize i = 0; i < elts.size (); i++)
{
This is incomplete: in case of an uneven number of rests, the
center one should be centered on the staff.
*/
- Drul_array<Link_array__Grob_ > ordered_rests;
+ Drul_array<vector<Grob*> > ordered_rests;
for (vsize i = 0; i < rests.size (); i++)
{
Grob *r = Note_column::get_rest (rests[i]);
/*
make this function easily usable in C++
*/
-std::string
-Rest::glyph_name (Grob *me, int balltype, std::string style, bool try_ledgers)
+string
+Rest::glyph_name (Grob *me, int balltype, string style, bool try_ledgers)
{
bool is_ledgered = false;
if (try_ledgers && (balltype == 0 || balltype == 1))
is_ledgered |= (balltype == 1) && (pos <= -rad - 2 || pos > +rad);
}
- std::string actual_style (style.c_str ());
+ string actual_style (style.c_str ());
if ((style == "mensural") || (style == "neomensural"))
{
int balltype = scm_to_int (balltype_scm);
- std::string style;
+ string style;
SCM style_scm = me->get_property ("style");
if (scm_is_symbol (style_scm))
style = ly_scm2string (scm_symbol_to_string (style_scm));
Font_metric *fm = Font_interface::get_default_font (me);
- std::string font_char = glyph_name (me, balltype, style, ledgered);
+ string font_char = glyph_name (me, balltype, style, ledgered);
Stencil out = fm->find_by_name (font_char);
if (out.is_empty ())
me->warning (_f ("rest `%s' not found", font_char.c_str ()));
class Rhythmic_column_engraver : public Engraver
{
- Link_array__Grob_ rheads_;
+ vector<Grob*> rheads_;
Grob *stem_;
Grob *note_column_;
Grob *dotcol_;
class Script_column_engraver : public Engraver
{
Grob *scol_;
- Link_array__Item_ scripts_;
+ vector<Item*> scripts_;
public:
TRANSLATOR_DECLARATIONS (Script_column_engraver);
{
Grob *me = unsmob_grob (smob);
Drul_array<SCM> scripts_drul (SCM_EOL, SCM_EOL);
- Link_array__Grob_ staff_sided;
+ vector<Grob*> staff_sided;
extract_grob_set (me, "scripts", scripts);
for (vsize i = 0; i < scripts.size (); i++)
class Script_engraver : public Engraver
{
- std::vector<Script_tuple> scripts_;
+ vector<Script_tuple> scripts_;
Spanner *slur_;
protected:
void
Separating_group_spanner::find_rods (Item *r,
- Link_array__Grob_ const &separators,
+ vector<Grob*> const &separators,
vsize idx,
Real padding)
{
struct Spacings
{
Item *staff_spacing_;
- Link_array__Item_ note_spacings_;
+ vector<Item*> note_spacings_;
Spacings ()
{
/* FIXME: 1000 should relate to paper size. */
if (fabs (total_off) > 1000)
{
- std::string msg
+ string msg
= String_convert::form_string ("Improbable offset for grob %s: %f%s",
me->name ().c_str (), total_off,
INTERNAL_UNIT);
else
spacer.my_solve_linelen ();
- std::vector<Real> posns;
+ vector<Real> posns;
posns.push_back (0.0);
for (vsize i = 0; i < spacer.springs_.size (); i++)
{
}
void
-Simple_spacer_wrapper::add_columns (Link_array__Grob_ const &icols)
+Simple_spacer_wrapper::add_columns (vector<Grob*> const &icols)
{
- Link_array__Grob_ cols (icols);
+ vector<Grob*> cols (icols);
cols.clear ();
for (vsize i = 0; i < icols.size (); i++)
binsearch.
*/
void
-insert_extent_into_skyline (std::vector<Skyline_entry> *line, Box b, Axis line_axis,
+insert_extent_into_skyline (vector<Skyline_entry> *line, Box b, Axis line_axis,
Direction d)
{
Interval extent = b[line_axis];
}
void
-merge_skyline (std::vector<Skyline_entry> *a1,
- std::vector<Skyline_entry> const &a2,
+merge_skyline (vector<Skyline_entry> *a1,
+ vector<Skyline_entry> const &a2,
Direction dir)
{
for (vsize i = 0; i < a2.size (); i++)
}
}
-std::vector<Skyline_entry>
+vector<Skyline_entry>
empty_skyline (Direction d)
{
- std::vector<Skyline_entry> skyline;
+ vector<Skyline_entry> skyline;
Interval i;
i.set_empty ();
return skyline;
}
-std::vector<Skyline_entry>
-extents_to_skyline (std::vector<Box> const &extents, Axis a, Direction d)
+vector<Skyline_entry>
+extents_to_skyline (vector<Box> const &extents, Axis a, Direction d)
{
- std::vector<Skyline_entry> skyline = empty_skyline (d);
+ vector<Skyline_entry> skyline = empty_skyline (d);
/*
This makes a cubic algorithm (array insertion is O (n),
This is an O (n) algorithm.
*/
Real
-skyline_meshing_distance (std::vector<Skyline_entry> const &buildings,
- std::vector<Skyline_entry> const &clouds)
+skyline_meshing_distance (vector<Skyline_entry> const &buildings,
+ vector<Skyline_entry> const &clouds)
{
int i = buildings.size () -1;
int j = clouds.size () -1;
}
void
-heighten_skyline (std::vector<Skyline_entry> *buildings, Real ground)
+heighten_skyline (vector<Skyline_entry> *buildings, Real ground)
{
for (vsize i = 0; i < buildings->size (); i++)
buildings->at (i).height_ += ground;
}
Real
-skyline_height (std::vector<Skyline_entry> const &buildings,
+skyline_height (vector<Skyline_entry> const &buildings,
Real airplane,
Direction sky_dir)
{
Bezier bez)
{
Offset horiz (1, 0);
- std::vector<Real> ts = bez.solve_derivative (horiz);
+ vector<Real> ts = bez.solve_derivative (horiz);
/* TODO: handle case of broken slur. */
if (!ts.empty ()
Real
fit_factor (Offset dz_unit, Offset dz_perp,
- Bezier curve, Direction d, std::vector<Offset> const &avoid)
+ Bezier curve, Direction d, vector<Offset> const &avoid)
{
Real fit_factor = 0.0;
Offset x0 = curve.control_[0];
void
Slur_configuration::generate_curve (Slur_score_state const &state,
Real r_0, Real h_inf,
- std::vector<Offset> const &avoid)
+ vector<Offset> const &avoid)
{
Offset dz = attachment_[RIGHT]- attachment_[LEFT];;
Offset dz_unit = dz;
Distances for heads that are between slur and line between
attachment points.
*/
- std::vector<Real> convex_head_distances;
+ vector<Real> convex_head_distances;
for (vsize j = 0; j < state.encompass_infos_.size (); j++)
{
Real x = state.encompass_infos_[j].x_;
{
Drul_array<Music *> events_;
Music *running_slur_start_;
- Link_array__Grob_ slurs_;
- Link_array__Grob_ end_slurs_;
+ vector<Grob*> slurs_;
+ vector<Grob*> end_slurs_;
void set_melisma (bool);
return y;
}
-std::vector<Offset>
+vector<Offset>
Slur_score_state::generate_avoid_offsets () const
{
- std::vector<Offset> avoid;
- Link_array__Grob_ encompasses = columns_;
+ vector<Offset> avoid;
+ vector<Grob*> encompasses = columns_;
for (vsize i = 0; i < encompasses.size (); i++)
{
Real r_0 = robust_scm2double (slur_->get_property ("ratio"), 0.33);
Real h_inf = staff_space_ * scm_to_double (slur_->get_property ("height-limit"));
- std::vector<Offset> avoid = generate_avoid_offsets ();
+ vector<Offset> avoid = generate_avoid_offsets ();
for (vsize i = 0; i < configurations_.size (); i++)
configurations_[i]->generate_curve (*this, r_0, h_inf, avoid);
}
-Link_array__Slur_configuration_
+vector<Slur_configuration*>
Slur_score_state::enumerate_attachments (Drul_array<Real> end_ys) const
{
- Link_array__Slur_configuration_ scores;
+ vector<Slur_configuration*> scores;
Drul_array<Offset> os;
os[LEFT] = base_attachments_[LEFT];
return scores;
}
-std::vector<Extra_collision_info>
+vector<Extra_collision_info>
Slur_score_state::get_extra_encompass_infos () const
{
extract_grob_set (slur_, "encompass-objects", encompasses);
- std::vector<Extra_collision_info> collision_infos;
+ vector<Extra_collision_info> collision_infos;
for (vsize i = encompasses.size (); i--;)
{
if (Slur::has_interface (encompasses[i]))
->lookup_variable (ly_symbol2scm ("debug-slur-scoring")))
&& scm_is_string (quant_score))
{
- std::string str;
+ string str;
SCM properties = Font_interface::text_font_alist_chain (me);
Stencil tm = *unsmob_stencil (Text_interface::interpret_markup
}
char *
-gulp_file (std::string filename, int *filesize)
+gulp_file (string filename, int *filesize)
{
/* "b" must ensure to open literally, avoiding text (CR/LF)
conversions. */
return str;
}
-Source_file::Source_file (std::string filename, std::string data)
+Source_file::Source_file (string filename, string data)
{
name_ = filename;
istream_ = 0;
newline_locations_.push_back (contents_str0_ + i);
}
-Source_file::Source_file (std::string filename_string)
+Source_file::Source_file (string filename_string)
{
name_ = filename_string;
istream_ = 0;
return istream_;
}
-std::string
+string
Source_file::file_line_column_string (char const *context_str0) const
{
if (!c_str ())
}
}
-std::string
+string
Source_file::quote_input (char const *pos_str0) const
{
if (!contains (pos_str0))
int l, ch, col;
get_counts (pos_str0, &l, &ch, &col);
- std::string line = line_string (pos_str0);
- std::string context = line.substr (0, ch)
+ string line = line_string (pos_str0);
+ string context = line.substr (0, ch)
+ to_string ('\n')
+ to_string (' ', col)
+ line.substr (ch, line.length()-ch);
return context;
}
-std::string
+string
Source_file::name_string () const
{
return map_file_name (name_);
return Slice (begin_str0 - data_str0, end_str0 - data_str0);
}
-std::string
+string
Source_file::line_string (char const *pos_str0) const
{
if (!contains (pos_str0))
Slice line = line_slice (pos_str0);
char const *data_str0 = c_str ();
- return std::string (data_str0 + line[LEFT], line.length ());
+ return string (data_str0 + line[LEFT], line.length ());
}
void
char const *line_start = (char const *)data + line[LEFT];
ssize left = (char const *) pos_str0 - line_start;
- std::string line_begin (line_start, left);
+ string line_begin (line_start, left);
char const *line_chars = line_begin.c_str ();
*column = 0;
return old_pos;
}
-std::string
+string
Source_file::get_string (int n)
{
- std::string str = std::string ((char const *)forward_str0 (n), n);
+ string str = string ((char const *)forward_str0 (n), n);
return str;
}
@return 0 if no file found
*/
Source_file *
-Sources::get_file (std::string &file_string) //UGH
+Sources::get_file (string &file_string) //UGH
{
if ((file_string != "-") && path_)
{
- std::string file_string_o = path_->find (file_string);
+ string file_string_o = path_->find (file_string);
if ((file_string_o == "") && (file_string != ""))
return 0;
file_string = file_string_o;
between.
*/
void
-Spacing_spanner::prune_loose_columns (Grob *me, Link_array__Grob_ *cols,
+Spacing_spanner::prune_loose_columns (Grob *me, vector<Grob*> *cols,
Spacing_options const *options)
{
- Link_array__Grob_ newcols;
+ vector<Grob*> newcols;
for (vsize i = 0; i < cols->size (); i++)
{
Set neighboring columns determined by the spacing-wishes grob property.
*/
void
-Spacing_spanner::set_explicit_neighbor_columns (Link_array__Grob_ const &cols)
+Spacing_spanner::set_explicit_neighbor_columns (vector<Grob*> const &cols)
{
for (vsize i = 0; i < cols.size (); i++)
{
yet. Only do breakable non-musical columns, and musical columns.
*/
void
-Spacing_spanner::set_implicit_neighbor_columns (Link_array__Grob_ const &cols)
+Spacing_spanner::set_implicit_neighbor_columns (vector<Grob*> const &cols)
{
for (vsize i = 0; i < cols.size (); i++)
{
class Spacing_engraver : public Engraver
{
PQueue<Rhythmic_tuple> playing_durations_;
- std::vector<Rhythmic_tuple> now_durations_;
- std::vector<Rhythmic_tuple> stopped_durations_;
+ vector<Rhythmic_tuple> now_durations_;
+ vector<Rhythmic_tuple> stopped_durations_;
Moment now_;
Spanner *spacing_;
Item *left = 0;
Item *right = 0;
- Link_array__Item_ clique;
+ vector<Item*> clique;
while (1)
{
SCM between = loose->get_object ("between-cols");
*/
Rational
Spacing_spanner::effective_shortest_duration (Grob *me,
- Link_array__Grob_ const &all)
+ vector<Grob*> const &all)
{
SCM preset_shortest = me->get_property ("common-shortest-duration");
Rational global_shortest;
/*
can't use get_system() ? --hwn.
*/
- Link_array__Grob_ all (get_root_system (me)->columns ());
+ vector<Grob*> all (get_root_system (me)->columns ());
set_explicit_neighbor_columns (all);
stuff, then.
*/
Rational
-Spacing_spanner::find_shortest (Grob *me, Link_array__Grob_ const &cols)
+Spacing_spanner::find_shortest (Grob *me, vector<Grob*> const &cols)
{
/*
ascending in duration
*/
- std::vector<Rational> durations;
- std::vector<int> counts;
+ vector<Rational> durations;
+ vector<int> counts;
Rational shortest_in_measure;
shortest_in_measure.set_infinite (1);
void
Spacing_spanner::generate_springs (Grob *me,
- Link_array__Grob_ const &cols,
+ vector<Grob*> const &cols,
Spacing_options const *options)
{
Paper_column *next = 0;
private:
Item *span_arpeggio_;
- Link_array__Grob_ arpeggios_;
+ vector<Grob*> arpeggios_;
};
Span_arpeggio_engraver::Span_arpeggio_engraver ()
class Span_bar_engraver : public Engraver
{
Item *spanbar_;
- Link_array__Item_ bars_;
+ vector<Item*> bars_;
public:
TRANSLATOR_DECLARATIONS (Span_bar_engraver);
if (!scm_is_string (glyph))
return SCM_EOL;
- std::string glyph_string = ly_scm2string (glyph);
+ string glyph_string = ly_scm2string (glyph);
/* compose span_bar_mol */
- std::vector<Interval> extents;
+ vector<Interval> extents;
Grob *model_bar = 0;
for (vsize i = elements.size (); i--;)
{
if (!me->is_live ())
return ly_interval2scm (Interval ());
- std::string gl = ly_scm2string (gn);
+ string gl = ly_scm2string (gn);
/*
urg.
return SCM_UNSPECIFIED;
}
- std::string type = ly_scm2string (gl);
+ string type = ly_scm2string (gl);
if (type == "|:")
type = ".|";
else if (type == ":|")
Real last_volume_;
Music *span_start_event_;
Drul_array<Music *> span_events_;
- std::vector<Audio_dynamic_tuple> dynamic_tuples_;
- std::vector<Audio_dynamic_tuple> finished_dynamic_tuples_;
+ vector<Audio_dynamic_tuple> dynamic_tuples_;
+ vector<Audio_dynamic_tuple> finished_dynamic_tuples_;
Direction dir_;
Direction finished_dir_;
};
else
{
System *root = get_root_system (this);
- Link_array__Item_ break_points = root->broken_col_range (left, right);
+ vector<Item*> break_points = root->broken_col_range (left, right);
break_points.insert (break_points.begin () + 0, left);
break_points.push_back (right);
TRANSLATOR_DECLARATIONS (Staff_performer);
~Staff_performer ();
- std::string new_instrument_string ();
- std::string instrument_string_;
+ string new_instrument_string ();
+ string instrument_string_;
protected:
virtual void acknowledge_audio_element (Audio_element_info info);
void
Staff_performer::process_music ()
{
- std::string str = new_instrument_string ();
+ string str = new_instrument_string ();
if (str.length ())
{
instrument_name_ = new Audio_text (Audio_text::INSTRUMENT_NAME, str);
audio_staff_ = 0;
}
-std::string
+string
Staff_performer::new_instrument_string ()
{
// mustn't ask Score for instrument: it will return piano!
SCM glyph = bar_grob->get_property ("glyph-name");
Grob *staff_sym = Staff_symbol_referencer::get_staff_symbol (bar_grob);
- std::string glyph_string = scm_is_string (glyph) ? ly_scm2string (glyph) : "";
+ string glyph_string = scm_is_string (glyph) ? ly_scm2string (glyph) : "";
if (glyph_string.substr (0, 1) == "|"
|| glyph_string.substr (0, 1) == ".")
{
TRANSLATOR_DECLARATIONS (Stanza_number_align_engraver);
protected:
- Link_array__Grob_ lyrics_;
- Link_array__Grob_ stanza_numbers_;
+ vector<Grob*> lyrics_;
+ vector<Grob*> stanza_numbers_;
DECLARE_ACKNOWLEDGER (lyric_syllable);
DECLARE_ACKNOWLEDGER (stanza_number);
}
/* The positions, in ascending order. */
-std::vector<int>
+vector<int>
Stem::note_head_positions (Grob *me)
{
- std::vector<int> ps;
+ vector<int> ps;
extract_grob_set (me, "note-heads", heads);
for (vsize i = heads.size (); i--;)
Real ss = Staff_symbol_referencer::staff_space (me);
int durlog = duration_log (me);
- std::vector<Real> a;
+ vector<Real> a;
/* WARNING: IN HALF SPACES */
Real length = robust_scm2double (me->get_property ("length"), 7);
return SCM_BOOL_T;
extract_grob_set (me, "note-heads", ro_heads);
- Link_array__Grob_ heads (ro_heads);
+ vector<Grob*> heads (ro_heads);
vector_sort (heads, compare_position);
Direction dir = get_grob_direction (me);
TODO: maybe property stroke-style should take different values,
e.g. "" (i.e. no stroke), "single" and "double" (currently, it's
'() or "grace"). */
- std::string flag_style;
+ string flag_style;
SCM flag_style_scm = me->get_property ("flag-style");
if (scm_is_symbol (flag_style_scm))
bool adjust = true;
- std::string staffline_offs;
+ string staffline_offs;
if (flag_style == "mensural")
/* Mensural notation: For notes on staff lines, use different
flags than for notes between staff lines. The idea is that
staffline_offs = "";
char dir = (get_grob_direction (me) == UP) ? 'u' : 'd';
- std::string font_char = flag_style
+ string font_char = flag_style
+ to_string (dir) + staffline_offs + to_string (log);
Font_metric *fm = Font_interface::get_default_font (me);
Stencil flag = fm->find_by_name ("flags." + font_char);
SCM stroke_style_scm = me->get_property ("stroke-style");
if (scm_is_string (stroke_style_scm))
{
- std::string stroke_style = ly_scm2string (stroke_style_scm);
+ string stroke_style = ly_scm2string (stroke_style_scm);
if (!stroke_style.empty ())
{
- std::string font_char = to_string (dir) + stroke_style;
+ string font_char = to_string (dir) + stroke_style;
Stencil stroke = fm->find_by_name ("flags." + font_char);
if (stroke.is_empty ())
me->warning (_f ("flag stroke `%s' not found", font_char));
if (!scm_is_string (glyph))
return mol.smobbed_copy ();
- std::string text = ly_scm2string (glyph);
+ string text = ly_scm2string (glyph);
for (ssize i = 0; i < text.length (); i++)
{
- std::string idx ("pedal.");
+ string idx ("pedal.");
if (text.substr (i, 3) == "Ped")
{
idx += "Ped";
i += 2;
}
else
- idx += std::string (&text.c_str ()[i], 1);
+ idx += string (&text.c_str ()[i], 1);
Stencil m = Font_interface::get_default_font (e)->find_by_name (idx);
if (!m.is_empty ())
mol.add_at_edge (X_AXIS, RIGHT, m, 0, 0);
struct Bracket_nesting_group : public Bracket_nesting_node
{
Spanner *delimiter_;
- Link_array__Bracket_nesting_node_ children_;
+ vector<Bracket_nesting_node*> children_;
SCM symbol_;
void from_list (SCM );
}
static void
-fixup_refpoints (Link_array__Grob_ const &grobs)
+fixup_refpoints (vector<Grob*> const &grobs)
{
for (vsize i = grobs.size (); i--;)
grobs[i]->fixup_refpoint ();
}
void
-System::break_into_pieces (std::vector<Column_x_positions> const &breaking)
+System::break_into_pieces (vector<Column_x_positions> const &breaking)
{
for (vsize i = 0; i < breaking.size (); i++)
{
System *system = dynamic_cast<System *> (clone (i));
system->rank_ = i;
- Link_array__Grob_ c (breaking[i].cols_);
+ vector<Grob*> c (breaking[i].cols_);
pscore_->typeset_system (system);
system->set_bound (LEFT, c[0]);
This might seem inefficient, but Stencils are cached per grob
anyway. */
- Link_array__Grob_ all_elts_sorted (all_elements_->array ());
+ vector<Grob*> all_elts_sorted (all_elements_->array ());
vector_sort (all_elts_sorted, default_compare);
uniq (all_elts_sorted);
this->get_stencil ();
return pl->unprotect ();
}
-Link_array__Item_
+vector<Item*>
System::broken_col_range (Item const *left, Item const *right) const
{
- Link_array__Item_ ret;
+ vector<Item*> ret;
left = left->get_column ();
right = right->get_column ();
/** Return all columns, but filter out any unused columns , since they might
disrupt the spacing problem. */
-Link_array__Grob_
+vector<Grob*>
System::columns () const
{
extract_grob_set (this, "columns", ro_columns);
break;
}
- Link_array__Grob_ columns;
+ vector<Grob*> columns;
for (int i = 0; i <= last_breakable; i++)
{
if (Paper_column::is_used (ro_columns[i]))
*/
class Tab_note_heads_engraver : public Engraver
{
- Link_array__Item_ notes_;
+ vector<Item*> notes_;
- Link_array__Item_ dots_;
- Link_array__Music_ note_events_;
- Link_array__Music_ tabstring_events_;
+ vector<Item*> dots_;
+ vector<Music*> note_events_;
+ vector<Music*> tabstring_events_;
public:
TRANSLATOR_DECLARATIONS (Tab_note_heads_engraver);
}
template<>
-std::string
+string
Interval_t<Rational>::T_to_string (Rational a)
{
return a.to_string ();
*/
class Text_engraver : public Engraver
{
- Link_array__Music_ evs_;
- Link_array__Item_ texts_;
+ vector<Music*> evs_;
+ vector<Item*> texts_;
public:
TRANSLATOR_DECLARATIONS (Text_engraver);
protected:
SCM_ASSERT_TYPE (scm_is_string (markup), markup, SCM_ARG3,
__FUNCTION__, "string");
- std::string str = ly_scm2string (markup);
+ string str = ly_scm2string (markup);
Font_metric *fm = select_encoded_font (layout, props);
return fm->text_stencil (str).smobbed_copy ();
Box b;
SCM limit = ly_lily_module_constant ("TEX_STRING_HASHLIMIT");
- std::string key_str = ly_scm2string (font->font_file_name ());
+ string key_str = ly_scm2string (font->font_file_name ());
int hash_code = scm_to_int (scm_hash (text, limit));
key_str = to_string (hash_code) + key_str;
}
void
-try_load_text_metrics (std::string basename)
+try_load_text_metrics (string basename)
{
- std::string path = global_path.find (basename + ".textmetrics");
+ string path = global_path.find (basename + ".textmetrics");
if (path != "")
{
- std::string contents (gulp_file_to_string (path, true, -1));
+ string contents (gulp_file_to_string (path, true, -1));
contents = "(quote (" + contents + "))";
SCM lst = scm_c_eval_string (contents.c_str ());
(1 << 20)
static const Real fix_to_real (Fix f);
-Tex_font_metric_reader::Tex_font_metric_reader (std::string name)
+Tex_font_metric_reader::Tex_font_metric_reader (string name)
: input_ (name)
{
return get_U32_fix () * info_.design_size;
}
-std::string
+string
Tex_font_metric_reader::get_bcpl_string ()
{
U8 length_u8 = input_.get_U8 ();
- std::string str = input_.get_string (length_u8);
+ string str = input_.get_string (length_u8);
return str;
}
#define KERN_FLAG 128
void
-Tex_font_metric_reader::read_lig_kern_program (std::vector<Tfm_ligature> *ligatures, std::vector<Tfm_kern> *kerns)
+Tex_font_metric_reader::read_lig_kern_program (vector<Tfm_ligature> *ligatures, vector<Tfm_kern> *kerns)
{
bool end_b;
}
SCM
-Tex_font_metric::make_tfm (std::string file_name)
+Tex_font_metric::make_tfm (string file_name)
{
Tex_font_metric *tfm = new Tex_font_metric;
Tex_font_metric_reader reader (file_name);
return info_.design_size * point_constant;
}
-std::string
+string
Tex_font_metric::font_name () const
{
return font_name_;
}
vsize
-Tex_font_metric::name_to_index (std::string) const
+Tex_font_metric::name_to_index (string) const
{
assert (false);
return 0;
{
Grob *me = unsmob_grob (smob);
extract_grob_set (me, "ties", ro_ties);
- Link_array__Grob_ ties (ro_ties);
+ vector<Grob*> ties (ro_ties);
if (!ties.size ())
return SCM_BOOL_T;
class Tie_engraver : public Engraver
{
Music *event_;
- Link_array__Grob_ now_heads_;
- std::vector<Head_event_tuple> heads_to_tie_;
- Link_array__Grob_ ties_;
+ vector<Grob*> now_heads_;
+ vector<Head_event_tuple> heads_to_tie_;
+ vector<Grob*> ties_;
Spanner *tie_column_;
}
void
-Tie_formatting_problem::set_chord_outline (Link_array__Item_ bounds,
+Tie_formatting_problem::set_chord_outline (vector<Item*> bounds,
Direction d)
{
Real staff_space = Staff_symbol_referencer::staff_space (bounds[0]);
- std::vector<Box> boxes;
+ vector<Box> boxes;
Grob *stem = 0;
for (vsize i = 0; i < bounds.size (); i++)
void
Tie_formatting_problem::from_tie (Grob *tie)
{
- Link_array__Grob_ ties;
+ vector<Grob*> ties;
ties.push_back (tie);
from_ties (ties);
}
void
-Tie_formatting_problem::from_ties (Link_array__Grob_ const &ties)
+Tie_formatting_problem::from_ties (vector<Grob*> const &ties)
{
if (ties.empty ())
return;
Direction d = LEFT;
do
{
- Link_array__Item_ bounds;
+ vector<Item*> bounds;
for (vsize i = 0; i < ties.size (); i++)
{
}
void
-Tie_formatting_problem::from_lv_ties (Link_array__Grob_ const &lv_ties)
+Tie_formatting_problem::from_lv_ties (vector<Grob*> const &lv_ties)
{
if (lv_ties.empty ())
return;
details_.from_grob (lv_ties[0]);
- Link_array__Item_ heads;
+ vector<Item*> heads;
for (vsize i = 0; i < lv_ties.size (); i++)
{
Tie_configuration
Tie_formatting_problem::find_optimal_tie_configuration (Tie_specification const &spec) const
{
- Link_array__Tie_configuration_ confs;
+ vector<Tie_configuration*> confs;
int pos = spec.position_;
Direction dir = spec.manual_dir_;
confs.push_back (generate_configuration (pos + i * dir, dir));
}
- std::vector<Real> scores;
+ vector<Real> scores;
int best_idx = -1;
Real best_score = 1e6;
Tie_formatting_problem::generate_optimal_chord_configuration ()
{
Ties_configuration base = generate_base_chord_configuration ();
- std::vector<Tie_configuration_variation> vars = get_variations (base);
+ vector<Tie_configuration_variation> vars = get_variations (base);
Ties_configuration best = base;
Real best_score = score_ties (best);
suggestion_ = 0;
}
-std::vector<Tie_configuration_variation>
+vector<Tie_configuration_variation>
Tie_formatting_problem::get_variations (Ties_configuration const &ties)
{
Real center_distance_tolerance = 0.25;
- std::vector<Tie_configuration_variation> vars;
+ vector<Tie_configuration_variation> vars;
Real last_center = 0.0;
for (vsize i = 0; i < ties.size (); i++)
{
{
Music *event_;
Music *last_event_;
- std::vector<Audio_element_info> now_heads_;
- std::vector<Audio_element_info> heads_to_tie_;
+ vector<Audio_element_info> now_heads_;
+ vector<Audio_element_info> heads_to_tie_;
bool ties_created_;
Stencil
Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d)
{
- std::string style = ly_scm2string (scm_symbol_to_string (scm_style));
+ string style = ly_scm2string (scm_symbol_to_string (scm_style));
if (style == "numbered")
return numbered_time_signature (me, n, d);
return numbered_time_signature (me, n, d);
}
- std::string char_name = style + to_string (n) + to_string (d);
+ string char_name = style + to_string (n) + to_string (d);
me->set_property ("font-encoding", ly_symbol2scm ("fetaMusic"));
Stencil out = Font_interface::get_default_font (me)
->find_by_name ("timesig." + char_name);
void
Translator_group::precomputed_translator_foreach (Translator_precompute_index idx)
{
- std::vector<Translator_method_binding> &bindings (precomputed_method_bindings_[idx]);
+ vector<Translator_method_binding> &bindings (precomputed_method_bindings_[idx]);
for (vsize i = 0; i < bindings.size (); i++)
bindings[i].invoke ();
}
void
add_acknowledger (Engraver_void_function_engraver_grob_info ptr,
char const *func_name,
- std::vector<Acknowledge_information> *ack_array)
+ vector<Acknowledge_information> *ack_array)
{
Acknowledge_information inf;
inf.function_ = ptr;
- std::string interface_name (func_name);
+ string interface_name (func_name);
interface_name = replace_all (interface_name, '_', '-');
interface_name += "-interface";
}
Engraver_void_function_engraver_grob_info
-generic_get_acknowledger (SCM sym, std::vector<Acknowledge_information> const *ack_array)
+generic_get_acknowledger (SCM sym, vector<Acknowledge_information> const *ack_array)
{
for (vsize i = 0; i < ack_array->size (); i++)
{
#define CHUNKSIZE 65534
static void
-print_body (void *out, std::string name)
+print_body (void *out, string name)
{
FILE *fd = fopen (name.c_str (), "rb");
}
static void
-create_type42_font (void *out, std::string name)
+create_type42_font (void *out, string name)
{
FT_Face face = open_ft_face (name);
{
SCM_ASSERT_TYPE (scm_is_string (ttf_file_name), ttf_file_name,
SCM_ARG1, __FUNCTION__, "string");
- std::string file_name = ly_scm2string (ttf_file_name);
+ string file_name = ly_scm2string (ttf_file_name);
if (be_verbose_global)
progress_indication ("[" + file_name);
SCM_ASSERT_TYPE (scm_is_string (ttf_file_name), ttf_file_name,
SCM_ARG1, __FUNCTION__, "string");
- std::string file_name = ly_scm2string (ttf_file_name);
+ string file_name = ly_scm2string (ttf_file_name);
if (be_verbose_global)
progress_indication ("[" + file_name);
Grob *
-Tuplet_bracket::parallel_beam (Grob *me_grob, Link_array__Grob_ const &cols, bool *equally_long)
+Tuplet_bracket::parallel_beam (Grob *me_grob, vector<Grob*> const &cols, bool *equally_long)
{
Spanner *me = dynamic_cast<Spanner *> (me_grob);
Real x0 = robust_relative_extent (lgr, commonx, X_AXIS)[LEFT];
Real x1 = robust_relative_extent (rgr, commonx, X_AXIS)[RIGHT];
- std::vector<Offset> points;
+ vector<Offset> points;
points.push_back (Offset (x0 - x0, staff[dir]));
points.push_back (Offset (x1 - x0, staff[dir]));
TRANSLATOR_DECLARATIONS (Tuplet_engraver);
protected:
- std::vector<Tuplet_description> tuplets_;
- Link_array__Spanner_ last_tuplets_;
+ vector<Tuplet_description> tuplets_;
+ vector<Spanner*> last_tuplets_;
DECLARE_ACKNOWLEDGER (note_column);
virtual bool try_music (Music *r);
virtual void finalize ();
int context_info, int delta_pitch);
bool is_stacked_head (int prefix_set,
int context_info);
- Real align_heads (std::vector<Grob_info> primitives,
+ Real align_heads (vector<Grob_info> primitives,
Real flexa_width,
Real thickness);
protected:
virtual Spanner *create_ligature_spanner ();
virtual void transform_heads (Spanner *ligature,
- std::vector<Grob_info> primitives);
+ vector<Grob_info> primitives);
};
Vaticana_ligature_engraver::Vaticana_ligature_engraver ()
}
Real
-Vaticana_ligature_engraver::align_heads (std::vector<Grob_info> primitives,
+Vaticana_ligature_engraver::align_heads (vector<Grob_info> primitives,
Real flexa_width,
Real thickness)
{
"ignoring grob");
continue;
}
- std::string glyph_name = ly_scm2string (glyph_name_scm);
+ string glyph_name = ly_scm2string (glyph_name_scm);
int delta_pitch = 0;
if (prev_primitive) /* urgh, need prev_primitive only here */
= scm_to_int (primitive->get_property ("prefix-set"));
if (prefix_set & ~PES_OR_FLEXA)
{
- std::string prefs = Gregorian_ligature::prefixes_to_str (primitive);
+ string prefs = Gregorian_ligature::prefixes_to_str (primitive);
primitive->warning (_f ("ignored prefix (es) `%s' of this head according "
"to restrictions of the selected ligature style",
prefs.c_str ()));
void
Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
- std::vector<Grob_info> primitives)
+ vector<Grob_info> primitives)
{
Real flexa_width = robust_scm2double (ligature->get_property ("flexa-width"), 2);
int prev_prefix_set = 0;
int prev_context_info = 0;
int prev_delta_pitch = 0;
- std::string prev_glyph_name = "";
+ string prev_glyph_name = "";
for (vsize i = 0; i < primitives.size (); i++)
{
Item *primitive = dynamic_cast<Item *> (primitives[i].grob ());
* this decision must be made here in the engraver rather than in
* the backend).
*/
- std::string glyph_name;
+ string glyph_name;
if (prefix_set & VIRGA)
{
glyph_name = "vaticana.punctum";
return Stencil ();
}
- std::string glyph_name = ly_scm2string (glyph_name_scm);
+ string glyph_name = ly_scm2string (glyph_name_scm);
Stencil out;
Real thickness = robust_scm2double (me->get_property ("thickness"), 1);
{
if (qualifies (i))
{
- std::string id = i.context ()->id_string ();
+ string id = i.context ()->id_string ();
scm_hash_set_x (id_to_group_hashtab_, scm_makfrom0str (id.c_str ()),
i.grob ()->self_scm ());
if (before_grob || after_grob)
{
Grob_array *ga = unsmob_grob_array (valign_->get_object ("elements"));
- Link_array__Grob_ &arr = ga->array_reference ();
+ vector<Grob*> &arr = ga->array_reference ();
Grob *added = arr.back ();
arr.pop_back ();
Grob *endbar = bars.size () ? bars.back () : 0;
SCM glyph = endbar ? endbar->get_property ("glyph") : SCM_EOL;
- std::string str;
+ string str;
if (scm_is_string (glyph))
str = ly_scm2string (glyph);
else
{
if (alt_count_)
{
- std::string repstr = to_string (rep_count_ - alt_count_ + done_count_) + ".";
+ string repstr = to_string (rep_count_ - alt_count_ + done_count_) + ".";
if (done_count_ > 1)
{
add_repeat_command (scm_list_n (ly_symbol2scm ("volta"), SCM_BOOL_F, SCM_UNDEFINED));