mirror of
https://github.com/akuker/RASCSI.git
synced 2025-01-05 14:31:47 +00:00
Added list of image files to protobuf interface
This commit is contained in:
parent
777b85d4ad
commit
5ddd177ff6
@ -477,8 +477,8 @@ void LogDeviceList(const string& device_list)
|
||||
set<string> GetAvailableImages() {
|
||||
set<string> available_images;
|
||||
|
||||
for (const auto & entry : filesystem::directory_iterator(default_image_folder)) {
|
||||
available_images.insert(entry.path());
|
||||
for (const auto& entry : filesystem::directory_iterator(default_image_folder)) {
|
||||
available_images.insert(entry.path().filename());
|
||||
}
|
||||
|
||||
return available_images;
|
||||
@ -889,6 +889,13 @@ static void *MonThread(void *param)
|
||||
PbServerInfo serverInfo;
|
||||
serverInfo.set_rascsi_version(rascsi_get_version_string());
|
||||
serverInfo.set_log_level(spdlog_log_level);
|
||||
serverInfo.set_default_image_folder(default_image_folder);
|
||||
set<string> available_images = GetAvailableImages();
|
||||
set<string>::iterator it = available_images.begin();
|
||||
while (it != available_images.end()) {
|
||||
serverInfo.add_available_images(*it);
|
||||
it++;
|
||||
}
|
||||
SerializeMessage(fd, serverInfo);
|
||||
}
|
||||
else {
|
||||
|
@ -179,6 +179,11 @@ void CommandServerInfo(const string& hostname, int port)
|
||||
|
||||
cout << "rascsi version: " << serverInfo.rascsi_version() << endl;
|
||||
cout << "rascsi log level: " << serverInfo.log_level() << endl;
|
||||
cout << "Default image folder: " << serverInfo.default_image_folder() << endl;
|
||||
cout << "Available image files:" << endl;
|
||||
for (int i = 0; i < serverInfo.available_images_size(); i++) {
|
||||
cout << " " << serverInfo.available_images(i) << endl;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user