• R/O
  • SSH
  • HTTPS

hamigaki: 提交


Commit MetaInfo

修訂1611 (tree)
時間2008-04-25 22:48:07
作者hamigaki

Log Message

supported to write UTF-8 for pax

Change Summary

差異

--- hamigaki/trunk/hamigaki/archivers/tar/headers.hpp (revision 1610)
+++ hamigaki/trunk/hamigaki/archivers/tar/headers.hpp (revision 1611)
@@ -1,6 +1,6 @@
11 // headers.hpp: tar headers
22
3-// Copyright Takeshi Mouri 2006, 2007.
3+// Copyright Takeshi Mouri 2006-2008.
44 // Distributed under the Boost Software License, Version 1.0.
55 // (See accompanying file LICENSE_1_0.txt or copy at
66 // http://www.boost.org/LICENSE_1_0.txt)
@@ -22,9 +22,13 @@
2222
2323 namespace hamigaki { namespace archivers { namespace tar {
2424
25-struct header
25+template<class Path>
26+struct basic_header
2627 {
27- boost::filesystem::path path;
28+ typedef Path path_type;
29+ typedef typename Path::string_type string_type;
30+
31+ Path path;
2832 boost::uint16_t permissions;
2933 boost::intmax_t uid;
3034 boost::intmax_t gid;
@@ -33,15 +37,15 @@
3337 boost::optional<filesystem::timestamp> access_time;
3438 boost::optional<filesystem::timestamp> change_time;
3539 char type_flag;
36- boost::filesystem::path link_path;
40+ Path link_path;
3741 file_format format;
38- std::string user_name;
39- std::string group_name;
42+ string_type user_name;
43+ string_type group_name;
4044 boost::uint16_t dev_major;
4145 boost::uint16_t dev_minor;
42- std::string comment;
46+ string_type comment;
4347
44- header()
48+ basic_header()
4549 : permissions(0644), uid(0), gid(0), file_size(0)
4650 , type_flag(tar::type_flag::regular), format(gnu)
4751 , dev_major(0), dev_minor(0)
@@ -98,6 +102,11 @@
98102 }
99103 };
100104
105+typedef basic_header<boost::filesystem::path> header;
106+#if !defined(BOOST_FILESYSTEM_NARROW_ONLY)
107+typedef basic_header<boost::filesystem::wpath> wheader;
108+#endif
109+
101110 } } } // End namespaces tar, archivers, hamigaki.
102111
103112 #endif // HAMIGAKI_ARCHIVERS_TAR_HEADERS_HPP
--- hamigaki/trunk/hamigaki/archivers/detail/ustar_file_source_impl.hpp (revision 1610)
+++ hamigaki/trunk/hamigaki/archivers/detail/ustar_file_source_impl.hpp (revision 1611)
@@ -22,7 +22,7 @@
2222 #include <algorithm>
2323 #include <cstring>
2424
25-namespace hamigaki { namespace archivers { namespace detail {
25+namespace hamigaki { namespace archivers { namespace tar_detail {
2626
2727 template<std::size_t Size>
2828 inline bool is_valid(const char (&s)[Size])
@@ -97,11 +97,11 @@
9797 if (std::memcmp(raw.magic, "ustar", 5) != 0)
9898 throw BOOST_IOSTREAMS_FAILURE("unknown tar header format");
9999
100- if (!detail::is_valid(raw.uname) || !detail::is_valid(raw.gname))
100+ if (!tar_detail::is_valid(raw.uname) || !tar_detail::is_valid(raw.gname))
101101 throw BOOST_IOSTREAMS_FAILURE("invalid tar header");
102102
103- const boost::filesystem::path name(detail::read_string(raw.name));
104- const boost::filesystem::path prefix(detail::read_string(raw.prefix));
103+ const boost::filesystem::path name(tar_detail::read_string(raw.name));
104+ const boost::filesystem::path prefix(tar_detail::read_string(raw.prefix));
105105
106106 tar::header head;
107107
@@ -116,27 +116,28 @@
116116 head.path = prefix / name;
117117 }
118118
119- head.permissions = detail::read_oct<boost::uint16_t>(raw.mode);
120- head.uid = detail::read_oct<boost::int32_t>(raw.uid);
121- head.gid = detail::read_oct<boost::int32_t>(raw.gid);
122- head.file_size = detail::read_oct<boost::uint64_t>(raw.size);
119+ head.permissions = tar_detail::read_oct<boost::uint16_t>(raw.mode);
120+ head.uid = tar_detail::read_oct<boost::int32_t>(raw.uid);
121+ head.gid = tar_detail::read_oct<boost::int32_t>(raw.gid);
122+ head.file_size = tar_detail::read_oct<boost::uint64_t>(raw.size);
123123 head.modified_time =
124124 filesystem::timestamp::from_time_t(
125- detail::read_oct<std::time_t>(raw.mtime));
125+ tar_detail::read_oct<std::time_t>(raw.mtime));
126126
127- detail::uint17_t chksum = detail::read_oct<detail::uint17_t>(raw.chksum);
127+ detail::uint17_t chksum =
128+ tar_detail::read_oct<detail::uint17_t>(raw.chksum);
128129 if (detail::tar_checksum(block) != chksum)
129130 throw BOOST_IOSTREAMS_FAILURE("invalid tar checksum");
130131
131132 head.type_flag = raw.typeflag ? raw.typeflag : '0';
132- head.link_path = detail::read_string(raw.linkname);
133+ head.link_path = tar_detail::read_string(raw.linkname);
133134
134- head.user_name = detail::read_c_string(raw.uname);
135- head.group_name = detail::read_c_string(raw.gname);
135+ head.user_name = tar_detail::read_c_string(raw.uname);
136+ head.group_name = tar_detail::read_c_string(raw.gname);
136137 if ((head.format != tar::gnu) || (head.is_device()))
137138 {
138- head.dev_major = detail::read_oct<boost::uint16_t>(raw.devmajor);
139- head.dev_minor = detail::read_oct<boost::uint16_t>(raw.devminor);
139+ head.dev_major = tar_detail::read_oct<boost::uint16_t>(raw.devmajor);
140+ head.dev_minor = tar_detail::read_oct<boost::uint16_t>(raw.devminor);
140141 }
141142 else
142143 {
@@ -147,6 +148,10 @@
147148 return head;
148149 }
149150
151+} } } // End namespaces tar_detail, archivers, hamigaki.
152+
153+namespace hamigaki { namespace archivers { namespace detail {
154+
150155 template<class Source>
151156 class basic_ustar_file_source_impl : private boost::noncopyable
152157 {
@@ -184,7 +189,7 @@
184189 iostreams::blocking_read(src_, block_, sizeof(block_));
185190 return false;
186191 }
187- header_ = detail::read_tar_header(block_);
192+ header_ = tar_detail::read_tar_header(block_);
188193
189194 return true;
190195 }
--- hamigaki/trunk/hamigaki/archivers/detail/tar_file_sink_impl.hpp (revision 1610)
+++ hamigaki/trunk/hamigaki/archivers/detail/tar_file_sink_impl.hpp (revision 1611)
@@ -11,9 +11,62 @@
1111 #define HAMIGAKI_ARCHIVERS_DETAIL_TAR_FILE_SINK_IMPL_HPP
1212
1313 #include <hamigaki/archivers/detail/ustar_file_sink_impl.hpp>
14+#include <hamigaki/charset/code_page.hpp>
15+#include <hamigaki/charset/utf8.hpp>
1416
15-namespace hamigaki { namespace archivers { namespace detail {
17+namespace hamigaki { namespace archivers { namespace tar_detail {
1618
19+inline std::string to_tar_string(const std::string& s)
20+{
21+ return s;
22+}
23+
24+inline std::string to_pax_string(const std::string& s)
25+{
26+ return charset::to_utf8(charset::from_code_page(s, 0));
27+}
28+
29+inline tar::header to_narrow(const tar::header& head)
30+{
31+ return head;
32+}
33+
34+#if !defined(BOOST_FILESYSTEM_NARROW_ONLY)
35+inline std::string to_tar_string(const std::wstring& ws)
36+{
37+ return charset::to_code_page(ws, 0, "_");
38+}
39+
40+inline std::string to_pax_string(const std::wstring& ws)
41+{
42+ return charset::to_utf8(ws);
43+}
44+
45+inline tar::header to_narrow(const tar::wheader& head)
46+{
47+ tar::header tmp;
48+
49+ tmp.path = tar_detail::to_tar_string(head.path.string());
50+ tmp.permissions = head.permissions;
51+ tmp.uid = head.uid;
52+ tmp.gid = head.gid;
53+ tmp.file_size = head.file_size;
54+ tmp.modified_time = head.modified_time;
55+ tmp.access_time = head.access_time;
56+ tmp.change_time = head.change_time;
57+ tmp.type_flag = head.type_flag;
58+ tmp.link_path = tar_detail::to_tar_string(head.link_path.string());
59+ tmp.format = head.format;
60+ tmp.user_name = charset::to_code_page(head.user_name, 0);
61+ tmp.group_name = charset::to_code_page(head.group_name, 0);
62+ tmp.dev_major = head.dev_major;
63+ tmp.dev_minor = head.dev_minor;
64+ tmp.comment = charset::to_code_page(head.comment, 0);
65+
66+ return tmp;
67+}
68+#endif
69+
1770 inline std::string
1871 make_ex_header_recoed(const std::string& key, const std::string value)
1972 {
@@ -38,9 +91,15 @@
3891 {
3992 return (static_cast<unsigned char>(c) & 0x80) != 0;
4093 }
94+
95+ bool operator()(wchar_t wc) const
96+ {
97+ return static_cast<boost::uint32_t>(wc) > 0x7F;
98+ }
4199 };
42100
43-inline bool is_non_ascii(const std::string& s)
101+template<class String>
102+inline bool is_non_ascii(const String& s)
44103 {
45104 return std::find_if(s.begin(), s.end(), is_non_ascii_func()) != s.end();
46105 }
@@ -81,7 +140,11 @@
81140 return to_dec<char>(x.seconds);
82141 }
83142
84-template<class Sink>
143+} } } // End namespaces tar_detail, archivers, hamigaki.
144+
145+namespace hamigaki { namespace archivers { namespace detail {
146+
147+template<class Sink, class Path>
85148 class basic_tar_file_sink_impl
86149 {
87150 private:
@@ -88,33 +151,42 @@
88151 typedef detail::basic_ustar_file_sink_impl<Sink> ustar_type;
89152
90153 public:
154+ typedef Path path_type;
155+ typedef tar::basic_header<Path> header_type;
156+
91157 explicit basic_tar_file_sink_impl(const Sink& sink) : ustar_(sink)
92158 {
93159 }
94160
95- void create_entry(const tar::header& head)
161+ void create_entry(const header_type& head)
96162 {
97- tar::header local = head;
163+ tar::header local = tar_detail::to_narrow(head);
98164
99- std::string name = head.path.string();
165+ std::string name = tar_detail::to_tar_string(head.path.string());
100166 std::string prefix;
101167 if ((head.format != tar::gnu) &&
102168 (name.size() > tar::raw_header::name_size) )
103169 {
104- name = head.path.leaf();
105- prefix = head.path.branch_path().string();
170+ name = tar_detail::to_tar_string(head.path.leaf());
171+ prefix =
172+ tar_detail::to_tar_string(head.path.branch_path().string());
106173 }
107174
108- std::string long_link = head.link_path.string();
175+ std::string long_link =
176+ tar_detail::to_tar_string(head.link_path.string());
109177 if (head.format == tar::pax)
110178 {
111179 std::string ex;
112180 if ((name.size() > tar::raw_header::name_size) ||
113- (prefix.size() > tar::raw_header::prefix_size))
181+ (prefix.size() > tar::raw_header::prefix_size) ||
182+ tar_detail::is_non_ascii(head.path.string()) )
114183 {
115- std::string long_name = head.path.string();
116- ex += detail::make_ex_header_recoed("path", long_name);
184+ std::string path =
185+ tar_detail::to_pax_string(head.path.string());
186+ ex += tar_detail::make_ex_header_recoed("path", path);
117187
188+ std::string long_name =
189+ tar_detail::to_tar_string(head.path.string());
118190 long_name.resize(tar::raw_header::name_size);
119191 local.path = long_name;
120192 }
@@ -121,7 +193,7 @@
121193
122194 if ((head.uid < 0) || (head.uid > tar::raw_header::max_uid))
123195 {
124- ex += detail::
196+ ex += tar_detail::
125197 make_ex_header_recoed("uid", to_dec<char>(head.uid));
126198
127199 local.uid = 0;
@@ -129,7 +201,7 @@
129201
130202 if ((head.gid < 0) || (head.gid > tar::raw_header::max_gid))
131203 {
132- ex += detail::
204+ ex += tar_detail::
133205 make_ex_header_recoed("gid", to_dec<char>(head.gid));
134206
135207 local.gid = 0;
@@ -137,7 +209,7 @@
137209
138210 if (head.file_size > tar::raw_header::max_size)
139211 {
140- ex += detail::
212+ ex += tar_detail::
141213 make_ex_header_recoed("size", to_dec<char>(head.file_size));
142214
143215 local.file_size = 0;
@@ -145,59 +217,72 @@
145217
146218 if (head.modified_time && (head.modified_time->nanoseconds != 0))
147219 {
148- ex += detail::make_ex_header_recoed(
220+ ex += tar_detail::make_ex_header_recoed(
149221 "mtime",
150- detail::from_timestamp(head.modified_time.get()));
222+ tar_detail::from_timestamp(head.modified_time.get()));
151223 }
152224
153225 if (head.access_time)
154226 {
155- ex += detail::make_ex_header_recoed(
227+ ex += tar_detail::make_ex_header_recoed(
156228 "atime",
157- detail::from_timestamp(head.access_time.get()));
229+ tar_detail::from_timestamp(head.access_time.get()));
158230 }
159231
160232 if (head.change_time)
161233 {
162- ex += detail::make_ex_header_recoed(
234+ ex += tar_detail::make_ex_header_recoed(
163235 "ctime",
164- detail::from_timestamp(head.change_time.get()));
236+ tar_detail::from_timestamp(head.change_time.get()));
165237 }
166238
167- if (long_link.size() > tar::raw_header::name_size)
239+ if ((long_link.size() > tar::raw_header::name_size) ||
240+ tar_detail::is_non_ascii(head.link_path.string()) )
168241 {
169- ex += detail::make_ex_header_recoed("linkpath", long_link);
242+ std::string linkpath =
243+ tar_detail::to_tar_string(head.link_path.string());
244+ ex += tar_detail::make_ex_header_recoed("linkpath", linkpath);
170245
171246 long_link.resize(tar::raw_header::name_size);
172247 local.link_path = long_link;
173248 }
174249
175- if (detail::is_non_ascii(head.user_name))
250+ if (tar_detail::is_non_ascii(head.user_name))
176251 {
177- ex += detail::
178- make_ex_header_recoed("uname", head.user_name);
252+ ex +=
253+ tar_detail::make_ex_header_recoed(
254+ "uname",
255+ tar_detail::to_pax_string(head.user_name)
256+ );
179257 }
180258
181- if (detail::is_non_ascii(head.group_name))
259+ if (tar_detail::is_non_ascii(head.group_name))
182260 {
183- ex += detail::
184- make_ex_header_recoed("gname", head.group_name);
261+ ex +=
262+ tar_detail::make_ex_header_recoed(
263+ "gname",
264+ tar_detail::to_pax_string(head.group_name)
265+ );
185266 }
186267
187268 if (!head.comment.empty())
188269 {
189- ex += detail::
190- make_ex_header_recoed("comment", head.comment);
270+ ex +=
271+ tar_detail::make_ex_header_recoed(
272+ "comment",
273+ tar_detail::to_pax_string(head.comment)
274+ );
191275 }
192276
193277 if (!ex.empty())
194- write_extended_header(head.path, ex);
278+ write_extended_header(local.path, ex);
195279 }
196280 else if (head.format == tar::gnu)
197281 {
198282 if (name.size() > tar::raw_header::name_size)
199283 {
200- std::string long_name = head.path.string();
284+ std::string long_name =
285+ tar_detail::to_tar_string(head.path.string());
201286 if (head.type_flag == tar::type_flag::directory)
202287 long_name += '/';
203288
--- hamigaki/trunk/hamigaki/archivers/detail/ustar_file_sink_impl.hpp (revision 1610)
+++ hamigaki/trunk/hamigaki/archivers/detail/ustar_file_sink_impl.hpp (revision 1611)
@@ -32,7 +32,7 @@
3232 #include <unistd.h>
3333 #endif
3434
35-namespace hamigaki { namespace archivers { namespace detail {
35+namespace hamigaki { namespace archivers { namespace tar_detail {
3636
3737 #if defined(BOOST_WINDOWS)
3838 inline unsigned long get_pid()
@@ -164,29 +164,32 @@
164164
165165 std::string prefix;
166166 if (head.is_long())
167- detail::write_string(raw.name, "././@LongLink");
167+ tar_detail::write_string(raw.name, "././@LongLink");
168168 else if (head.type_flag == tar::type_flag::extended)
169- detail::write_string(raw.name, detail::make_ex_header_name(head.path));
169+ {
170+ tar_detail::write_string(
171+ raw.name, tar_detail::make_ex_header_name(head.path));
172+ }
170173 else
171174 {
172175 std::string name;
173176 split_path(head.path, prefix, name);
174- detail::write_string(raw.name, name);
177+ tar_detail::write_string(raw.name, name);
175178 }
176179
177- detail::write_oct(raw.mode, head.permissions);
178- detail::write_oct(raw.uid, head.uid);
179- detail::write_oct(raw.gid, head.gid);
180- detail::write_oct(raw.size, head.file_size);
180+ tar_detail::write_oct(raw.mode, head.permissions);
181+ tar_detail::write_oct(raw.uid, head.uid);
182+ tar_detail::write_oct(raw.gid, head.gid);
183+ tar_detail::write_oct(raw.size, head.file_size);
181184 if (head.modified_time)
182- detail::write_oct(raw.mtime, head.modified_time->seconds);
185+ tar_detail::write_oct(raw.mtime, head.modified_time->seconds);
183186 else
184- detail::write_oct(raw.mtime, static_cast<std::time_t>(0));
187+ tar_detail::write_oct(raw.mtime, static_cast<std::time_t>(0));
185188 std::memset(raw.chksum, ' ', sizeof(raw.chksum));
186189 raw.typeflag = head.type_flag;
187190
188191 if (head.type_flag != tar::type_flag::extended)
189- detail::write_string(raw.linkname, linkname);
192+ tar_detail::write_string(raw.linkname, linkname);
190193
191194 std::strcpy(raw.magic, "ustar");
192195 if (head.format == tar::gnu)
@@ -198,15 +201,15 @@
198201 else
199202 std::memcpy(raw.version, "00", 2);
200203
201- detail::write_c_string(raw.uname, head.user_name);
202- detail::write_c_string(raw.gname, head.group_name);
204+ tar_detail::write_c_string(raw.uname, head.user_name);
205+ tar_detail::write_c_string(raw.gname, head.group_name);
203206
204207 if ((head.format != tar::gnu) || (head.dev_major != 0))
205- detail::write_oct(raw.devmajor, head.dev_major);
208+ tar_detail::write_oct(raw.devmajor, head.dev_major);
206209 if ((head.format != tar::gnu) || (head.dev_minor != 0))
207- detail::write_oct(raw.devminor, head.dev_minor);
210+ tar_detail::write_oct(raw.devminor, head.dev_minor);
208211
209- detail::write_string(raw.prefix, prefix);
212+ tar_detail::write_string(raw.prefix, prefix);
210213
211214 std::memset(block, 0, tar::raw_header::block_size);
212215 hamigaki::binary_write(block, raw);
@@ -219,6 +222,10 @@
219222 hamigaki::binary_write(block, raw);
220223 }
221224
225+} } } // End namespaces tar_detail, archivers, hamigaki.
226+
227+namespace hamigaki { namespace archivers { namespace detail {
228+
222229 template<class Sink>
223230 class basic_ustar_file_sink_impl : private boost::noncopyable
224231 {
@@ -241,7 +248,7 @@
241248 if (pos_ != size_)
242249 throw BOOST_IOSTREAMS_FAILURE("tar entry size mismatch");
243250
244- detail::write_tar_header(block_, head);
251+ tar_detail::write_tar_header(block_, head);
245252 iostreams::blocking_write(sink_, block_, sizeof(block_));
246253
247254 pos_ = 0;
--- hamigaki/trunk/hamigaki/archivers/detail/tar_file_source_impl.hpp (revision 1610)
+++ hamigaki/trunk/hamigaki/archivers/detail/tar_file_source_impl.hpp (revision 1611)
@@ -18,7 +18,7 @@
1818 #include <boost/ref.hpp>
1919 #include <boost/scoped_array.hpp>
2020
21-namespace hamigaki { namespace archivers { namespace detail {
21+namespace hamigaki { namespace archivers { namespace tar_detail {
2222
2323 inline boost::uint32_t decode_nsec(const char* beg, const char* end)
2424 {
@@ -58,10 +58,14 @@
5858
5959 inline filesystem::timestamp to_timestamp(const char* beg, const char* end)
6060 {
61- return detail::to_timestamp(std::string(beg, end));
61+ return tar_detail::to_timestamp(std::string(beg, end));
6262 }
6363
64-template<class Source>
64+} } } // End namespaces tar_detail, archivers, hamigaki.
65+
66+namespace hamigaki { namespace archivers { namespace detail {
67+
68+template<class Source, class Path=boost::filesystem::path>
6569 class basic_tar_file_source_impl
6670 {
6771 private:
@@ -228,11 +232,11 @@
228232 else if (key == "size")
229233 ext.file_size = hamigaki::from_dec<boost::uintmax_t>(beg, end);
230234 else if (key == "mtime")
231- ext.modified_time = detail::to_timestamp(beg, end);
235+ ext.modified_time = tar_detail::to_timestamp(beg, end);
232236 else if (key == "atime")
233- ext.access_time = detail::to_timestamp(beg, end);
237+ ext.access_time = tar_detail::to_timestamp(beg, end);
234238 else if (key == "ctime")
235- ext.change_time = detail::to_timestamp(beg, end);
239+ ext.change_time = tar_detail::to_timestamp(beg, end);
236240 else if (key == "linkpath")
237241 ext.link_path = beg;
238242 else if (key == "uname")
--- hamigaki/trunk/hamigaki/archivers/tar_file.hpp (revision 1610)
+++ hamigaki/trunk/hamigaki/archivers/tar_file.hpp (revision 1611)
@@ -1,6 +1,6 @@
11 // tar_file.hpp: POSIX tar file device
22
3-// Copyright Takeshi Mouri 2006, 2007.
3+// Copyright Takeshi Mouri 2006-2008.
44 // Distributed under the Boost Software License, Version 1.0.
55 // (See accompanying file LICENSE_1_0.txt or copy at
66 // http://www.boost.org/LICENSE_1_0.txt)
@@ -94,11 +94,11 @@
9494 };
9595
9696
97-template<class Sink>
97+template<class Sink, class Path=boost::filesystem::path>
9898 class basic_tar_file_sink
9999 {
100100 private:
101- typedef detail::basic_tar_file_sink_impl<Sink> impl_type;
101+ typedef detail::basic_tar_file_sink_impl<Sink,Path> impl_type;
102102
103103 public:
104104 typedef char char_type;
@@ -109,7 +109,8 @@
109109 , boost::iostreams::closable_tag
110110 {};
111111
112- typedef tar::header header_type;
112+ typedef Path path_type;
113+ typedef tar::basic_header<Path> header_type;
113114
114115 explicit basic_tar_file_sink(const Sink& sink)
115116 : pimpl_(new impl_type(sink))
@@ -116,7 +117,7 @@
116117 {
117118 }
118119
119- void create_entry(const tar::header& head)
120+ void create_entry(const header_type& head)
120121 {
121122 pimpl_->create_entry(head);
122123 }
@@ -156,6 +157,7 @@
156157 , boost::iostreams::closable_tag
157158 {};
158159
160+ typedef boost::filesystem::path path_type;
159161 typedef tar::header header_type;
160162
161163 explicit tar_file_sink(const std::string& filename)
@@ -192,6 +194,56 @@
192194 basic_tar_file_sink<iostreams::file_sink> impl_;
193195 };
194196
197+#if !defined(BOOST_FILESYSTEM_NARROW_ONLY)
198+class wtar_file_sink
199+{
200+public:
201+ typedef char char_type;
202+
203+ struct category
204+ : boost::iostreams::output
205+ , boost::iostreams::device_tag
206+ , boost::iostreams::closable_tag
207+ {};
208+
209+ typedef boost::filesystem::wpath path_type;
210+ typedef tar::wheader header_type;
211+
212+ explicit wtar_file_sink(const std::string& filename)
213+ : impl_(iostreams::file_sink(filename, BOOST_IOS::binary))
214+ {
215+ }
216+
217+ void create_entry(const tar::wheader& head)
218+ {
219+ impl_.create_entry(head);
220+ }
221+
222+ void rewind_entry()
223+ {
224+ throw std::runtime_error("unsupported operation");
225+ }
226+
227+ std::streamsize write(const char* s, std::streamsize n)
228+ {
229+ return impl_.write(s, n);
230+ }
231+
232+ void close()
233+ {
234+ impl_.close();
235+ }
236+
237+ void close_archive()
238+ {
239+ impl_.close_archive();
240+ }
241+
242+private:
243+ basic_tar_file_sink<iostreams::file_sink,path_type> impl_;
244+};
245+#endif // !defined(BOOST_FILESYSTEM_NARROW_ONLY)
246+
195247 } } // End namespaces archivers, hamigaki.
196248
197249 #endif // HAMIGAKI_ARCHIVERS_TAR_FILE_HPP
Show on old repository browser