src/FileAttributeFinder.h
branchv_0
changeset 7 8d73bff730a7
parent 6 35607c973cf5
child 8 eb1ecb37c6b7
--- a/src/FileAttributeFinder.h	Wed Jan 16 18:01:49 2019 +0100
+++ b/src/FileAttributeFinder.h	Wed Jan 16 18:16:07 2019 +0100
@@ -78,6 +78,7 @@
 	static const string_t FIELD_PATH_CANONICAL;
 	static const string_t FIELD_TYPE;
 	static const string_t FIELD_SYMLINK_TARGET_TYPE;
+	static const string_t FIELD_SYMLINK_TARGET;
 	static const string_t FIELD_OWNER;
 	static const string_t FIELD_GROUP;
 
@@ -118,6 +119,8 @@
 					writer->writeAttribute(getType(currentFile, true));
 				} else if (field.name == FIELD_SYMLINK_TARGET_TYPE) {
 					writer->writeAttribute(getType(currentFile, false));
+				} else if (field.name == FIELD_SYMLINK_TARGET) {
+					writer->writeAttribute(fs::is_symlink(currentFile) ? fs::read_symlink(currentFile).wstring() : L""); // TODO: null value (when supported)
 				} else if (field.name == FIELD_SIZE) {
 					integer_t size = fs::is_regular_file(currentFile) ? fs::file_size(currentFile) : 0;
 					writer->writeAttribute(&size, typeid (size));
@@ -146,6 +149,7 @@
 const string_t FileAttributeFinder::FIELD_PATH_CANONICAL = L"path_canonical";
 const string_t FileAttributeFinder::FIELD_TYPE = L"type";
 const string_t FileAttributeFinder::FIELD_SYMLINK_TARGET_TYPE = L"symlink_target_type";
+const string_t FileAttributeFinder::FIELD_SYMLINK_TARGET = L"symlink_target";
 const string_t FileAttributeFinder::FIELD_OWNER = L"owner";
 const string_t FileAttributeFinder::FIELD_GROUP = L"group";