OSDN Git Service

eltorito.hpp: とりあえず最初の0x8800バイトまでを書き込むようにしてみた。
authorMyun2 <myun2@nwhite.info>
Tue, 10 Aug 2010 18:07:52 +0000 (03:07 +0900)
committerMyun2 <myun2@nwhite.info>
Tue, 10 Aug 2010 18:07:52 +0000 (03:07 +0900)
roast_ex/include/roast/file/iso9660/eltorito.hpp

index a551528..a01b10c 100644 (file)
@@ -6,11 +6,35 @@
 #ifndef __SFJP_ROAST_EX__file__iso9660__eltorito_HPP__
 #define __SFJP_ROAST_EX__file__iso9660__eltorito_HPP__
 
+#include <fstream>
+#include "roast/lexical/string_rule.hpp"
+
 namespace roast
 {
        namespace iso9660
        {
+               namespace eltorito
+               {
+                       using namespace ::roast::lexical::rule;
+
+                       typedef soft_repeat< unibyte<0>, 0x8800 > rule;
+               }
+
+               class eltorito_writer
+               {
+               public:
+                       bool write(const char* filename, const unsigned char* boot_img, size_t size )
+                       {
+                               ::std::fstream fs(filename, std::ios::out | std::ios::binary);
+                               if ( fs.fail() )
+                                       return false;
+
+                               eltorito::rule rl;
+                               rl.generate(fs, boot_img);
 
+                               return true;
+                       }
+               };
        }
 }