OLD | NEW |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 1997--2019 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2019 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 Jan Nieuwenhuizen <janneke@gnu.org> | 5 Jan Nieuwenhuizen <janneke@gnu.org> |
6 | 6 |
7 LilyPond is free software: you can redistribute it and/or modify | 7 LilyPond is free software: you can redistribute it and/or modify |
8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
9 the Free Software Foundation, either version 3 of the License, or | 9 the Free Software Foundation, either version 3 of the License, or |
10 (at your option) any later version. | 10 (at your option) any later version. |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // update `file_name' to hold `dir' and `file_name' concatenated | 135 // update `file_name' to hold `dir' and `file_name' concatenated |
136 file_name.root_ = dir.root_; | 136 file_name.root_ = dir.root_; |
137 dir.root_ = ""; | 137 dir.root_ = ""; |
138 | 138 |
139 file_name.is_absolute_ = dir.is_absolute_; | 139 file_name.is_absolute_ = dir.is_absolute_; |
140 dir.is_absolute_ = false; | 140 dir.is_absolute_ = false; |
141 | 141 |
142 if (file_name.dir_.empty ()) | 142 if (file_name.dir_.empty ()) |
143 file_name.dir_ = dir.to_string (); | 143 file_name.dir_ = dir.to_string (); |
144 else if (!dir.to_string ().empty ()) | 144 else if (!dir.to_string ().empty ()) |
145 file_name.dir_ = dir.to_string () | 145 file_name.dir_ = dir.to_string () + DIRSEP + file_name.dir_; |
146 + ::to_string (DIRSEP) + file_name.dir_; | |
147 | 146 |
148 if (is_file (file_name.to_string ())) | 147 if (is_file (file_name.to_string ())) |
149 return file_name.to_string (); | 148 return file_name.to_string (); |
150 } | 149 } |
151 | 150 |
152 return ""; | 151 return ""; |
153 } | 152 } |
154 | 153 |
155 /* | 154 /* |
156 Try to find | 155 Try to find |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 } | 195 } |
197 | 196 |
198 string | 197 string |
199 File_path::to_string () const | 198 File_path::to_string () const |
200 { | 199 { |
201 string s; | 200 string s; |
202 for (vsize i = 0; i < dirs_.size (); i++) | 201 for (vsize i = 0; i < dirs_.size (); i++) |
203 { | 202 { |
204 s = s + dirs_[i]; | 203 s = s + dirs_[i]; |
205 if (i < dirs_.size () - 1) | 204 if (i < dirs_.size () - 1) |
206 s += ::to_string (PATHSEP); | 205 s += PATHSEP; |
207 } | 206 } |
208 return s; | 207 return s; |
209 } | 208 } |
210 | 209 |
211 void | 210 void |
212 File_path::append (const string &str) | 211 File_path::append (const string &str) |
213 { | 212 { |
214 dirs_.push_back (str); | 213 dirs_.push_back (str); |
215 } | 214 } |
216 | 215 |
217 void | 216 void |
218 File_path::prepend (const string &str) | 217 File_path::prepend (const string &str) |
219 { | 218 { |
220 dirs_.insert (dirs_.begin (), str); | 219 dirs_.insert (dirs_.begin (), str); |
221 } | 220 } |
OLD | NEW |