X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Ffile-path.cc;h=65cd517e5a07247fc798277631be1857601679e0;hb=2bbacb364aa29041af9cbbbd32cfad2e8e387cb3;hp=850592bd36280cb622f1b3fde6f12ee2f90f37a7;hpb=bb8a0a5387af94dd2702877256334b160575a730;p=lilypond.git diff --git a/flower/file-path.cc b/flower/file-path.cc index 850592bd36..65cd517e5a 100644 --- a/flower/file-path.cc +++ b/flower/file-path.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2011 Han-Wen Nienhuys + Copyright (C) 1997--2015 Han-Wen Nienhuys Jan Nieuwenhuizen LilyPond is free software: you can redistribute it and/or modify @@ -39,21 +39,22 @@ #define PATHSEP ':' #endif +#include + vector File_path::directories () const { return dirs_; } -#include void -File_path::parse_path (string p) +File_path::parse_path (const string &p) { concat (dirs_, string_split (p, PATHSEP)); } bool -is_file (string file_name) +is_file (const string &file_name) { #if !STAT_MACROS_BROKEN struct stat sbuf; @@ -106,7 +107,7 @@ directory, in this order. The file name if found, or empty string if not found. */ string -File_path::find (string name) const +File_path::find (const string &name) const { if (!name.length () || (name == "-")) return name; @@ -146,7 +147,7 @@ File_path::find (string name) const where EXT is from EXTENSIONS. */ string -File_path::find (string name, char const *extensions[]) +File_path::find (const string &name, char const *extensions[]) { if (name.empty () || name == "-") return name; @@ -195,13 +196,13 @@ File_path::to_string () const } void -File_path::append (string str) +File_path::append (const string &str) { dirs_.push_back (str); } void -File_path::prepend (string str) +File_path::prepend (const string &str) { dirs_.insert (dirs_.begin (), str); }