summaryrefslogtreecommitdiff
path: root/indra/llcommon/fsyspath.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-06-28 07:54:46 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-09-18 16:52:45 -0400
commit837a6e04d85e4f3f301e62aea3329ea61e926566 (patch)
treeeb8488deb526601be0cf9276b7a237e29c736bd5 /indra/llcommon/fsyspath.h
parente829828dcd9b989a9efb32f7c69cd8652e9857ec (diff)
Give our fsyspath an operator std::string() conversion method.
This is redundant (but harmless) on a Posix system, but it fills a missing puzzle piece on Windows. The point of fsyspath is to be able to interchange freely between fsyspath and std::string. Existing fsyspath could be constructed and assigned from std::string, and we could explicitly call its string() method to get a std::string, but an implicit fsyspath-to-string conversion that worked on Posix would trip us up on Windows. Fix that. (cherry picked from commit fbeff6d8052d4b614a0a2c8ebaf35b45379ab578)
Diffstat (limited to 'indra/llcommon/fsyspath.h')
-rw-r--r--indra/llcommon/fsyspath.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/indra/llcommon/fsyspath.h b/indra/llcommon/fsyspath.h
index aa4e0132bc..3c749d84de 100644
--- a/indra/llcommon/fsyspath.h
+++ b/indra/llcommon/fsyspath.h
@@ -69,6 +69,11 @@ public:
// shadow base-class string() method with UTF-8 aware method
std::string string() const { return super::u8string(); }
+ // On Posix systems, where value_type is already char, this operator
+ // std::string() method shadows the base class operator string_type()
+ // method. But on Windows, where value_type is wchar_t, the base class
+ // doesn't have operator std::string(). Provide it.
+ operator std::string() const { return string(); }
};
#endif /* ! defined(LL_FSYSPATH_H) */