mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-22 08:02:08 +02:00
haskell: add packToHandle'
This commit is contained in:
@@ -25,6 +25,7 @@ module Data.MessagePack(
|
|||||||
-- * Pack functions
|
-- * Pack functions
|
||||||
packToString,
|
packToString,
|
||||||
packToHandle,
|
packToHandle,
|
||||||
|
packToHandle',
|
||||||
packToFile,
|
packToFile,
|
||||||
|
|
||||||
-- * Unpack functions
|
-- * Unpack functions
|
||||||
@@ -83,6 +84,10 @@ packToString = runPut
|
|||||||
packToHandle :: Handle -> Put -> IO ()
|
packToHandle :: Handle -> Put -> IO ()
|
||||||
packToHandle h = L.hPutStr h . packToString
|
packToHandle h = L.hPutStr h . packToString
|
||||||
|
|
||||||
|
-- | Pack to Handle and Flush Handle
|
||||||
|
packToHandle' :: Handle -> Put -> IO ()
|
||||||
|
packToHandle' h p = packToHandle h p >> hFlush h
|
||||||
|
|
||||||
-- | Pack to File
|
-- | Pack to File
|
||||||
packToFile :: FilePath -> Put -> IO ()
|
packToFile :: FilePath -> Put -> IO ()
|
||||||
packToFile path = L.writeFile path . packToString
|
packToFile path = L.writeFile path . packToString
|
||||||
|
Reference in New Issue
Block a user