@@ -26,15 +26,20 @@ namespace xt
2626 xio_aws_handler ();
2727
2828 template <class E >
29- void write (const xexpression<E>& expression, const Aws::String & path, xfile_dirty dirty);
29+ void write (const xexpression<E>& expression, const std::string & path, xfile_dirty dirty);
3030
3131 template <class ET >
32- void read (ET& array, const Aws::String & path);
32+ void read (ET& array, const std::string & path);
3333
3434 void configure (const C& format_config, const xio_aws_config& io_config);
3535 void configure_io (const xio_aws_config& io_config);
3636
3737 private:
38+ template <class E >
39+ void write (const xexpression<E>& expression, const char * path, xfile_dirty dirty);
40+
41+ template <class ET >
42+ void read (ET& array, const char * path);
3843
3944 C m_format_config;
4045 Aws::S3::S3Client m_client;
@@ -48,16 +53,24 @@ namespace xt
4853
4954 template <class C >
5055 template <class E >
51- inline void xio_aws_handler<C>::write(const xexpression<E>& expression, const Aws::String& path, xfile_dirty dirty)
56+ inline void xio_aws_handler<C>::write(const xexpression<E>& expression, const std::string& path, xfile_dirty dirty)
57+ {
58+ write (expression, path.c_str (), dirty);
59+ }
60+
61+ template <class C >
62+ template <class E >
63+ inline void xio_aws_handler<C>::write(const xexpression<E>& expression, const char * path, xfile_dirty dirty)
5264 {
5365 if (m_format_config.will_dump (dirty))
5466 {
67+ Aws::String path2 = path;
5568 Aws::S3::Model::PutObjectRequest request;
5669 request.SetBucket (m_bucket);
57- request.SetKey (path );
70+ request.SetKey (path2 );
5871
59- std::shared_ptr<Aws::IOStream> writer = Aws::MakeShared<Aws::FStream>(" SampleAllocationTag" , path. c_str () , std::ios_base::in | std::ios_base::binary);
60- dump_file (writer, expression, m_format_config);
72+ std::shared_ptr<Aws::IOStream> writer = Aws::MakeShared<Aws::FStream>(" SampleAllocationTag" , path, std::ios_base::in | std::ios_base::binary);
73+ dump_file (* writer, expression, m_format_config);
6174
6275 request.SetBody (writer);
6376
@@ -73,11 +86,19 @@ namespace xt
7386
7487 template <class C >
7588 template <class ET >
76- inline void xio_aws_handler<C>::read(ET& array, const Aws::String& path)
89+ inline void xio_aws_handler<C>::read(ET& array, const std::string& path)
90+ {
91+ read (array, path.c_str ());
92+ }
93+
94+ template <class C >
95+ template <class ET >
96+ inline void xio_aws_handler<C>::read(ET& array, const char * path)
7797 {
98+ Aws::String path2 = path;
7899 Aws::S3::Model::GetObjectRequest request;
79100 request.SetBucket (m_bucket);
80- request.SetKey (path );
101+ request.SetKey (path2 );
81102
82103 Aws::S3::Model::GetObjectOutcome outcome = m_client.GetObject (request);
83104
0 commit comments