Skip to content

Commit

Permalink
Fix quoted
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Aug 27, 2024
1 parent 6e498e4 commit d6521f5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/xtd.core/include/xtd/basic_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -1606,8 +1606,8 @@ namespace xtd {
/// @return A new quoted basic_string.
/// @remarks for more information see [std::quoted](https://en.cppreference.com/w/cpp/io/manip/quoted).
basic_string quoted(value_type delimiter, value_type escape) const {
std::stringstream ss;
ss << std::quoted(__xtd_convert_to_string<char>(chars_), static_cast<char>(delimiter), static_cast<char>(escape));
std::wstringstream ss;
ss << std::quoted(__xtd_convert_to_string<xtd::wchar>(chars_), static_cast<xtd::wchar>(delimiter), static_cast<xtd::wchar>(escape));
return ss.str();
}

Expand Down Expand Up @@ -3158,7 +3158,7 @@ inline std::basic_string<target_t> __xtd_convert_to_string(std::basic_string<sou
}
}
str.clear();
return std::move(out);
return out;
}

template<>
Expand Down
24 changes: 16 additions & 8 deletions tests/xtd.forms.manual_tests/src/manual_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
#include <xtd/xtd>

using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;

class form1 : public form {
public:
form1() {
text("Forms manual test");
}
};
using namespace xtd::io;

auto main()->int {
application::run(form1 {});
console::write_line("application_resources = {}", xtd::environment::get_folder_path(xtd::environment::special_folder::application_resources));
auto form1 = form::create("form1");
auto button1 = button::create(form1, "Take a\nscreenshot", {10, 10});
button1.auto_size(true);
button1.click += [&] {
form1.hide();
application::do_events();
auto b = bitmap {screen::primary_screen().bounds().width(), screen::primary_screen().bounds().height()};
b.create_graphics().copy_from_screen({0, 0}, {0, 0}, screen::primary_screen().bounds().size());
b.save(path::combine(environment::get_folder_path(environment::special_folder::desktop), "screenshot.png"));
form1.show();
};
application::run(form1);
}

0 comments on commit d6521f5

Please sign in to comment.