string::size_type const abslen = abspath.length();
string::size_type const baselen = basepath.length();
- string::size_type i = os::common_path(abspath, basepath);
+ // FIXME UNICODE
+ docstring::size_type i =
+ os::common_path(from_utf8(abspath), from_utf8(basepath));
if (i == 0) {
// actually no match - cannot make it relative
#include "support/docstring.h"
-#include <string>
-
namespace lyx {
namespace support {
/// Extract the path common to both @c p1 and @c p2. DBCS aware!
/// \p p1, \p p2 and the return value are encoded in utf8.
-std::string::size_type common_path(std::string const & p1, std::string const & p2);
+docstring::size_type common_path(docstring const & p1, docstring const & p2);
/// Converts a unix style path to host OS style.
/// \p p and the return value are encoded in utf8.
}
-string::size_type common_path(string const & p1, string const & p2)
+docstring::size_type common_path(docstring const & p1, docstring const & p2)
{
- string::size_type i = 0;
- string::size_type p1_len = p1.length();
- string::size_type p2_len = p2.length();
+ docstring::size_type i = 0;
+ docstring::size_type const p1_len = p1.length();
+ docstring::size_type const p2_len = p2.length();
while (i < p1_len && i < p2_len && uppercase(p1[i]) == uppercase(p2[i]))
++i;
if ((i < p1_len && i < p2_len)
}
-string::size_type common_path(string const & p1, string const & p2)
+docstring::size_type common_path(docstring const & p1, docstring const & p2)
{
- string::size_type i = 0;
- string::size_type p1_len = p1.length();
- string::size_type p2_len = p2.length();
+ docstring::size_type i = 0;
+ docstring::size_type const p1_len = p1.length();
+ docstring::size_type const p2_len = p2.length();
while (i < p1_len && i < p2_len && p1[i] == p2[i])
++i;
if ((i < p1_len && i < p2_len)
}
-string::size_type common_path(string const & p1, string const & p2)
+docstring::size_type common_path(docstring const & p1, docstring const & p2)
{
- string::size_type i = 0;
- string::size_type p1_len = p1.length();
- string::size_type p2_len = p2.length();
+ docstring::size_type i = 0;
+ docstring::size_type const p1_len = p1.length();
+ docstring::size_type const p2_len = p2.length();
while (i < p1_len && i < p2_len && uppercase(p1[i]) == uppercase(p2[i]))
++i;
if ((i < p1_len && i < p2_len)