home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Found / FWStream / Sources / FWStrmF.cpp < prev    next >
Encoding:
Text File  |  1994-04-21  |  23.2 KB  |  669 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWStrmF.cpp
  4. //    Release Version:    $ 1.0d1 $
  5. //
  6. //    Creation Date:        3/28/94
  7. //
  8. //    Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef FWSTRMF_H
  13. #include "FWStrmF.h"
  14. #endif
  15.  
  16. #ifndef FWPRISTR_H
  17. #include "FWPriStr.h"
  18. #endif
  19.  
  20. #ifndef FWMATH_H
  21. #include "FWMath.h"
  22. #endif
  23.  
  24. #ifndef FWEXCDEF_H
  25. #include "FWExcDef.h"
  26. #endif
  27.  
  28. #pragma segment FWStream
  29.  
  30. //========================================================================================
  31. //    CLASS FW_CReadableStreamFormatter
  32. //========================================================================================
  33.  
  34. //----------------------------------------------------------------------------------------
  35. // FW_CReadableStreamFormatter::FW_CReadableStreamFormatter
  36. //----------------------------------------------------------------------------------------
  37.  
  38. FW_CReadableStreamFormatter::FW_CReadableStreamFormatter()
  39. {
  40. }
  41.  
  42. //----------------------------------------------------------------------------------------
  43. // FW_CReadableStreamFormatter::~FW_CReadableStreamFormatter
  44. //----------------------------------------------------------------------------------------
  45.  
  46. FW_CReadableStreamFormatter::~FW_CReadableStreamFormatter()
  47. {
  48. }
  49.  
  50. //----------------------------------------------------------------------------------------
  51. // FW_CReadableStreamFormatter::ReadBytes
  52. //----------------------------------------------------------------------------------------
  53.  
  54. void FW_CReadableStreamFormatter::ReadBytes(FW_CSink& sink,
  55.                                             void* destination,
  56.                                             long count)
  57. {
  58.     Identity(sink, destination, count, 1);
  59. }
  60.  
  61. //----------------------------------------------------------------------------------------
  62. // FW_CReadableStreamFormatter::ReadChars
  63. //----------------------------------------------------------------------------------------
  64.  
  65. void FW_CReadableStreamFormatter::ReadChars(FW_CSink& sink,
  66.                                             char* destination,
  67.                                             long count)
  68. {
  69.     Identity(sink, destination, count, sizeof(char));
  70. }
  71.     
  72. //----------------------------------------------------------------------------------------
  73. // FW_CReadableStreamFormatter::ReadSignedChars
  74. //----------------------------------------------------------------------------------------
  75.  
  76. void FW_CReadableStreamFormatter::ReadSignedChars(FW_CSink& sink,
  77.                                                   signed char* destination,
  78.                                                   long count)
  79. {
  80.     Identity(sink, destination, count, sizeof(signed char));
  81. }
  82.  
  83. //----------------------------------------------------------------------------------------
  84. // FW_CReadableStreamFormatter::ReadUnsignedChars
  85. //----------------------------------------------------------------------------------------
  86.  
  87. void FW_CReadableStreamFormatter::ReadUnsignedChars(FW_CSink& sink,
  88.                                                     unsigned char* destination,
  89.                                                     long count)
  90. {
  91.     Identity(sink, destination, count, sizeof(unsigned char));
  92. }
  93.  
  94. //----------------------------------------------------------------------------------------
  95. // FW_CReadableStreamFormatter::ReadNullTerminatedString
  96. //----------------------------------------------------------------------------------------
  97.  
  98. void FW_CReadableStreamFormatter::ReadNullTerminatedString(FW_CSink& sink,
  99.                                                            char* destination)
  100. {
  101.     long totalBytesCopied = 0;
  102.     long availableReadBytes;
  103.     const char * source = (const char *)sink.ReadPeek(availableReadBytes);
  104.     long i;
  105.     char copyChar;
  106.     FW_Boolean foundTerminator = FALSE;
  107.  
  108.     // Read sink until null terminator found or no bytes to read.
  109.     while (!foundTerminator && availableReadBytes)
  110.     {
  111.         // Copy all characters until null-terminator found or all available bytes copied.
  112.         for (i = 0; !foundTerminator && (i < availableReadBytes); ++i)
  113.         {
  114.             copyChar = source[i];
  115.             *destination++ = copyChar; // Note: null-terminator is copied too.
  116.              if (copyChar == '\0')
  117.                 foundTerminator = TRUE;
  118.         }
  119.  
  120.         // Advance sink position by number of characters processed.
  121.         sink.ReadPeekAdvance(i);
  122.  
  123.         // If null-terminator not found, advance position in sink.
  124.         if (!foundTerminator)
  125.         {
  126.             totalBytesCopied += availableReadBytes;
  127.             source = (const char *)sink.ReadPeek(availableReadBytes);
  128.         }
  129.     }
  130.  
  131.     if (!foundTerminator)
  132.         FW_THROW(FW_XReadableStreamFormatter(0, 1, totalBytesCopied));
  133. }
  134.  
  135. //----------------------------------------------------------------------------------------
  136. // FW_CReadableStreamFormatter::ReadInts
  137. //----------------------------------------------------------------------------------------
  138.  
  139. void FW_CReadableStreamFormatter::ReadInts(FW_CSink& sink,
  140.                                            int* destination,
  141.                                            long count)
  142. {
  143.     Identity(sink, destination, count, sizeof(int));
  144. }
  145.  
  146. //----------------------------------------------------------------------------------------
  147. // FW_CReadableStreamFormatter::ReadUnsignedInts
  148. //----------------------------------------------------------------------------------------
  149.  
  150. void FW_CReadableStreamFormatter::ReadUnsignedInts(FW_CSink& sink,
  151.                                                    unsigned int* destination,
  152.                                                    long count)
  153. {
  154.     Identity(sink, destination, count, sizeof(unsigned int));
  155. }
  156.  
  157. //----------------------------------------------------------------------------------------
  158. // FW_CReadableStreamFormatter::ReadShorts
  159. //----------------------------------------------------------------------------------------
  160.  
  161. void FW_CReadableStreamFormatter::ReadShorts(FW_CSink& sink,
  162.                                              short* destination,
  163.                                              long count)
  164. {
  165.     Identity(sink, destination, count, sizeof(short));
  166. }
  167.  
  168. //----------------------------------------------------------------------------------------
  169. // FW_CReadableStreamFormatter::ReadUnsignedShorts
  170. //----------------------------------------------------------------------------------------
  171.  
  172. void FW_CReadableStreamFormatter::ReadUnsignedShorts(FW_CSink& sink,
  173.                                                      unsigned short* destination,
  174.                                                      long count)
  175. {
  176.     Identity(sink, destination, count, sizeof(unsigned short));
  177. }
  178.  
  179. //----------------------------------------------------------------------------------------
  180. // FW_CReadableStreamFormatter::ReadLongs
  181. //----------------------------------------------------------------------------------------
  182.  
  183. void FW_CReadableStreamFormatter::ReadLongs(FW_CSink& sink,
  184.                                             long* destination,
  185.                                             long count)
  186. {
  187.     Identity(sink, destination, count, sizeof(long));
  188. }
  189.     
  190. //----------------------------------------------------------------------------------------
  191. // FW_CReadableStreamFormatter::ReadUnsignedLongs
  192. //----------------------------------------------------------------------------------------
  193.  
  194. void FW_CReadableStreamFormatter::ReadUnsignedLongs(FW_CSink& sink,
  195.                                                     unsigned long* destination,
  196.                                                     long count)
  197. {
  198.     Identity(sink, destination, count, sizeof(unsigned long));
  199. }
  200.  
  201. //----------------------------------------------------------------------------------------
  202. // FW_CReadableStreamFormatter::ReadFloats
  203. //----------------------------------------------------------------------------------------
  204.  
  205. void FW_CReadableStreamFormatter::ReadFloats(FW_CSink& sink,
  206.                                              float* destination,
  207.                                              long count)
  208. {
  209.     Identity(sink, destination, count, sizeof(float));
  210. }
  211.  
  212. //----------------------------------------------------------------------------------------
  213. // FW_CReadableStreamFormatter::ReadDoubles
  214. //----------------------------------------------------------------------------------------
  215.  
  216. void FW_CReadableStreamFormatter::ReadDoubles(FW_CSink& sink,
  217.                                               double* destination,
  218.                                               long count)
  219. {
  220.     Identity(sink, destination, count, sizeof(double));
  221. }
  222.  
  223. #ifdef FW_COMPILER_SUPPORTS_LONG_DOUBLE
  224. //----------------------------------------------------------------------------------------
  225. // FW_CReadableStreamFormatter::ReadLongDoubles
  226. //----------------------------------------------------------------------------------------
  227.  
  228. void FW_CReadableStreamFormatter::ReadLongDoubles(FW_CSink& sink,
  229.                                                   long double* destination,
  230.                                                   long count)
  231. {
  232.     Identity(sink, destination, count, sizeof(long double));
  233. }
  234. #endif
  235.  
  236. //----------------------------------------------------------------------------------------
  237. // FW_CReadableStreamFormatter::Identity
  238. //----------------------------------------------------------------------------------------
  239.  
  240. void FW_CReadableStreamFormatter::Identity(FW_CSink& sink,
  241.                                            void* destination,
  242.                                            long count,
  243.                                            long itemSize)
  244. {
  245.     char* currentDestination = (char*) destination;
  246.     long totalBytesToRead = count * itemSize;
  247.     long bytesLeftToRead = totalBytesToRead;
  248.     long bytesAvailable = sink.GetReadableBytes();
  249.     long bytesToReadThisTime = FW_Minimum(bytesLeftToRead, bytesAvailable);
  250.  
  251.     while (bytesToReadThisTime)
  252.     {
  253.         sink.Read(currentDestination, bytesToReadThisTime);
  254.         currentDestination += bytesToReadThisTime;
  255.         bytesLeftToRead -= bytesToReadThisTime;
  256.         bytesAvailable = sink.GetReadableBytes();
  257.         bytesToReadThisTime = FW_Minimum(bytesLeftToRead, bytesAvailable);
  258.     }
  259.  
  260.     if (bytesLeftToRead)
  261.         FW_THROW(FW_XReadableStreamFormatter(count, itemSize, (totalBytesToRead - bytesLeftToRead) / itemSize));
  262. }
  263.  
  264.  
  265. //======================================================================================
  266. //    class FW_CSwapBytesFormatter
  267. //======================================================================================
  268.  
  269. //----------------------------------------------------------------------------------------
  270. // FW_CSwapBytesFormatter::FW_CSwapBytesFormatter
  271. //----------------------------------------------------------------------------------------
  272.  
  273. FW_CSwapBytesFormatter::FW_CSwapBytesFormatter()
  274. {
  275. }
  276.  
  277. //----------------------------------------------------------------------------------------
  278. // FW_CSwapBytesFormatter::~FW_CSwapBytesFormatter
  279. //----------------------------------------------------------------------------------------
  280.  
  281. FW_CSwapBytesFormatter::~FW_CSwapBytesFormatter()
  282. {
  283. }
  284.  
  285. //----------------------------------------------------------------------------------------
  286. // FW_CSwapBytesFormatter::ReadInts
  287. //----------------------------------------------------------------------------------------
  288.  
  289. void FW_CSwapBytesFormatter::ReadInts(FW_CSink& sink,
  290.                                       int* destination,
  291.                                       long count)
  292. {
  293.     if (sizeof(int) == sizeof(short))
  294.         ReadShorts(sink, (short*)destination, count);
  295.     else if (sizeof(int) == sizeof(long))
  296.         ReadLongs(sink, (long*)destination, count);
  297.     else
  298.         FW_ASSERT(FALSE);
  299. }
  300.  
  301. //----------------------------------------------------------------------------------------
  302. // FW_CSwapBytesFormatter::ReadUnsignedInts
  303. //----------------------------------------------------------------------------------------
  304.  
  305. void FW_CSwapBytesFormatter::ReadUnsignedInts(FW_CSink& sink,
  306.                                               unsigned int* destination,
  307.                                               long count)
  308. {
  309.     ReadInts(sink, (int*)destination, count);
  310. }
  311.  
  312. //----------------------------------------------------------------------------------------
  313. // FW_CSwapBytesFormatter::ReadShorts
  314. //----------------------------------------------------------------------------------------
  315.  
  316. void FW_CSwapBytesFormatter::ReadShorts(FW_CSink& sink,
  317.                                         short* destination,
  318.                                         long count)
  319. {
  320.     FW_CReadableStreamFormatter::ReadShorts(sink, destination, count);
  321.  
  322.     short* p = destination;
  323.     while (p < destination + count)
  324.     {
  325.         char* s = (char*)p;
  326.         char c = s[0];
  327.         s[0] = s[1];
  328.         s[1] = c;
  329.  
  330.         p++;
  331.     }
  332. }
  333.  
  334. //----------------------------------------------------------------------------------------
  335. // FW_CSwapBytesFormatter::ReadUnsignedShorts
  336. //----------------------------------------------------------------------------------------
  337.  
  338. void FW_CSwapBytesFormatter::ReadUnsignedShorts(FW_CSink& sink,
  339.                                                 unsigned short* destination,
  340.                                                 long count)
  341. {
  342.     ReadShorts(sink, (short*)destination, count);
  343. }
  344.  
  345. //----------------------------------------------------------------------------------------
  346. // FW_CSwapBytesFormatter::ReadLongs
  347. //----------------------------------------------------------------------------------------
  348.  
  349. void FW_CSwapBytesFormatter::ReadLongs(FW_CSink& sink,
  350.                                        long* destination,
  351.                                        long count)
  352. {
  353.     FW_CReadableStreamFormatter::ReadLongs(sink, destination, count);
  354.  
  355.     long* p = destination;
  356.     while (p < destination + count)
  357.     {
  358.         char* s = (char*)p;
  359.         char c = s[0];
  360.         s[0] = s[3];
  361.         s[3] = c;
  362.         c = s[1];
  363.         s[1] = s[2];
  364.         s[2] = c;
  365.  
  366.         p++;
  367.     }
  368. }
  369.  
  370. //----------------------------------------------------------------------------------------
  371. // FW_CSwapBytesFormatter::ReadUnsignedLongs
  372. //----------------------------------------------------------------------------------------
  373.  
  374. void FW_CSwapBytesFormatter::ReadUnsignedLongs(FW_CSink& sink,
  375.                                                unsigned long* destination,
  376.                                                long count)
  377. {
  378.     ReadLongs(sink, (long*)destination, count);
  379. }
  380.  
  381.  
  382. //========================================================================================
  383. //    CLASS FW_CWritableStreamFormatter
  384. //========================================================================================
  385.  
  386. //----------------------------------------------------------------------------------------
  387. // FW_CWritableStreamFormatter::FW_CWritableStreamFormatter
  388. //----------------------------------------------------------------------------------------
  389.  
  390. FW_CWritableStreamFormatter::FW_CWritableStreamFormatter()
  391. {
  392. }
  393.  
  394. //----------------------------------------------------------------------------------------
  395. // FW_CWritableStreamFormatter::~FW_CWritableStreamFormatter
  396. //----------------------------------------------------------------------------------------
  397.  
  398. FW_CWritableStreamFormatter::~FW_CWritableStreamFormatter()
  399. {
  400. }
  401.  
  402. //----------------------------------------------------------------------------------------
  403. // FW_CWritableStreamFormatter::WriteBytes
  404. //----------------------------------------------------------------------------------------
  405.  
  406. void FW_CWritableStreamFormatter::WriteBytes(FW_CSink& sink,
  407.                                              const void* source,
  408.                                              long count)
  409. {
  410.     Identity(sink, source, count, 1);
  411. }
  412.  
  413. //----------------------------------------------------------------------------------------
  414. // FW_CWritableStreamFormatter::WriteChars
  415. //----------------------------------------------------------------------------------------
  416.  
  417. void FW_CWritableStreamFormatter::WriteChars(FW_CSink& sink,
  418.                                              const char* source,
  419.                                              long count)
  420. {
  421.     Identity(sink, source, count, sizeof(char));
  422. }
  423.  
  424. //----------------------------------------------------------------------------------------
  425. // FW_CWritableStreamFormatter::WriteSignedChars
  426. //----------------------------------------------------------------------------------------
  427.  
  428. void FW_CWritableStreamFormatter::WriteSignedChars(FW_CSink& sink,
  429.                                                    const signed char* source,
  430.                                                    long count)
  431. {
  432.     Identity(sink, source, count, sizeof(signed char));
  433. }
  434.  
  435. //----------------------------------------------------------------------------------------
  436. // FW_CWritableStreamFormatter::WriteUnsignedChars
  437. //----------------------------------------------------------------------------------------
  438.  
  439. void FW_CWritableStreamFormatter::WriteUnsignedChars(FW_CSink& sink,
  440.                                                      const unsigned char* source,
  441.                                                      long count)
  442. {
  443.     Identity(sink, source, count, sizeof(unsigned char));
  444. }
  445.  
  446. //----------------------------------------------------------------------------------------
  447. // FW_CWritableStreamFormatter::WriteNullTerminatedString
  448. //----------------------------------------------------------------------------------------
  449.  
  450. void FW_CWritableStreamFormatter::WriteNullTerminatedString(FW_CSink& sink,
  451.                                                             const char* source)
  452. {
  453.     Identity(sink, source, FW_PrimitiveStringLength(source) + 1, 1);
  454. }
  455.  
  456. //----------------------------------------------------------------------------------------
  457. // FW_CWritableStreamFormatter::WriteInts
  458. //----------------------------------------------------------------------------------------
  459.  
  460. void FW_CWritableStreamFormatter::WriteInts(FW_CSink& sink,
  461.                                             const int* source,
  462.                                             long count)
  463. {
  464.     Identity(sink, source, count, sizeof(int));
  465. }
  466.     
  467. //----------------------------------------------------------------------------------------
  468. // FW_CWritableStreamFormatter::WriteUnsignedInts
  469. //----------------------------------------------------------------------------------------
  470.  
  471. void FW_CWritableStreamFormatter::WriteUnsignedInts(FW_CSink& sink,
  472.                                                     const unsigned int* source,
  473.                                                     long count)
  474. {
  475.     Identity(sink, source, count, sizeof(unsigned int));
  476. }
  477.  
  478. //----------------------------------------------------------------------------------------
  479. // FW_CWritableStreamFormatter::WriteShorts
  480. //----------------------------------------------------------------------------------------
  481.  
  482. void FW_CWritableStreamFormatter::WriteShorts(FW_CSink& sink,
  483.                                               const short* source,
  484.                                               long count)
  485. {
  486.     Identity(sink, source, count, sizeof(short));
  487. }
  488.     
  489. //----------------------------------------------------------------------------------------
  490. // FW_CWritableStreamFormatter::WriteUnsignedShorts
  491. //----------------------------------------------------------------------------------------
  492.  
  493. void FW_CWritableStreamFormatter::WriteUnsignedShorts(FW_CSink& sink,
  494.                                                       const unsigned short* source,
  495.                                                       long count)
  496. {
  497.     Identity(sink, source, count, sizeof(unsigned short));
  498. }
  499.  
  500. //----------------------------------------------------------------------------------------
  501. // FW_CWritableStreamFormatter::WriteLongs
  502. //----------------------------------------------------------------------------------------
  503.  
  504. void FW_CWritableStreamFormatter::WriteLongs(FW_CSink& sink,
  505.                                              const long* source,
  506.                                              long count)
  507. {
  508.     Identity(sink, source, count, sizeof(long));
  509. }
  510.  
  511. //----------------------------------------------------------------------------------------
  512. // FW_CWritableStreamFormatter::WriteUnsignedLongs
  513. //----------------------------------------------------------------------------------------
  514.  
  515. void FW_CWritableStreamFormatter::WriteUnsignedLongs(FW_CSink& sink,
  516.                                                      const unsigned long* source,
  517.                                                      long count)
  518. {
  519.     Identity(sink, source, count, sizeof(unsigned long));
  520. }
  521.  
  522. //----------------------------------------------------------------------------------------
  523. // FW_CWritableStreamFormatter::WriteFloats
  524. //----------------------------------------------------------------------------------------
  525.  
  526. void FW_CWritableStreamFormatter::WriteFloats(FW_CSink& sink,
  527.                                               const float* source,
  528.                                               long count)
  529. {
  530.     Identity(sink, source, count, sizeof(float));
  531. }
  532.  
  533. //----------------------------------------------------------------------------------------
  534. // FW_CWritableStreamFormatter::WriteDoubles
  535. //----------------------------------------------------------------------------------------
  536.  
  537. void FW_CWritableStreamFormatter::WriteDoubles(FW_CSink& sink,
  538.                                                const double* source,
  539.                                                long count)
  540. {
  541.     Identity(sink, source, count, sizeof(double));
  542. }
  543.  
  544. #ifdef FW_COMPILER_SUPPORTS_LONG_DOUBLE
  545. //----------------------------------------------------------------------------------------
  546. // FW_CWritableStreamFormatter::WriteLongDoubles
  547. //----------------------------------------------------------------------------------------
  548.  
  549. void FW_CWritableStreamFormatter::WriteLongDoubles(FW_CSink& sink,
  550.                                                    const long double* source,
  551.                                                    long count)
  552. {
  553.     Identity(sink, source, count, sizeof(long double));
  554. }
  555. #endif
  556.  
  557. //----------------------------------------------------------------------------------------
  558. // FW_CWritableStreamFormatter::Identity
  559. //----------------------------------------------------------------------------------------
  560.  
  561. void FW_CWritableStreamFormatter::Identity(FW_CSink& sink,
  562.                                            const void* source,
  563.                                            long count,
  564.                                            long itemSize)
  565. {
  566.     const char* currentSource = (const char*) source;
  567.     long totalBytesToWrite = count * itemSize;
  568.     long bytesLeftToWrite = totalBytesToWrite;
  569.     long bytesAvailable = sink.GetWritableBytes();
  570.     long bytesToWriteThisTime = FW_Minimum(bytesLeftToWrite, bytesAvailable);
  571.  
  572.     while (bytesToWriteThisTime)
  573.     {
  574.         sink.Write(currentSource, bytesToWriteThisTime);
  575.         currentSource += bytesToWriteThisTime;
  576.         bytesLeftToWrite -= bytesToWriteThisTime;
  577.         bytesAvailable = sink.GetWritableBytes();
  578.         bytesToWriteThisTime = FW_Minimum(bytesLeftToWrite, bytesAvailable);
  579.     }
  580.  
  581.     if (bytesLeftToWrite)
  582.         FW_THROW(FW_XWritableStreamFormatter(count, itemSize, (totalBytesToWrite - bytesLeftToWrite) / itemSize));
  583. }
  584.  
  585.  
  586. //========================================================================================
  587. //    CLASS FW_XReadableStreamFormatter
  588. //========================================================================================
  589.  
  590. _FW_EXCEPTION_IMPLEMENT(FW_XReadableStreamFormatter,
  591.                         FW_XPrivException)
  592.  
  593. //----------------------------------------------------------------------------------------
  594. //    FW_XReadableStreamFormatter::FW_XReadableStreamFormatter
  595. //----------------------------------------------------------------------------------------
  596.  
  597. FW_XReadableStreamFormatter::FW_XReadableStreamFormatter(long itemsRequested,
  598.                                                          long itemSize,
  599.                                                          long itemsRead) :
  600.     FW_XPrivException(),
  601.     fItemsRequested(itemsRequested),
  602.     fItemSize(itemSize),
  603.     fItemsRead(itemsRead)
  604. {
  605. }
  606.  
  607. //----------------------------------------------------------------------------------------
  608. //    FW_XReadableStreamFormatter::FW_XReadableStreamFormatter
  609. //----------------------------------------------------------------------------------------
  610.  
  611. FW_XReadableStreamFormatter::FW_XReadableStreamFormatter(const FW_XReadableStreamFormatter& formatter) :
  612.     FW_XPrivException(),
  613.     fItemsRequested(formatter.fItemsRequested),
  614.     fItemSize(formatter.fItemSize),
  615.     fItemsRead(formatter.fItemsRead)
  616. {
  617. }
  618.  
  619. //----------------------------------------------------------------------------------------
  620. //    FW_XReadableStreamFormatter::~FW_XReadableStreamFormatter
  621. //----------------------------------------------------------------------------------------
  622.  
  623. FW_XReadableStreamFormatter::~FW_XReadableStreamFormatter()
  624. {
  625. }
  626.  
  627.  
  628. //========================================================================================
  629. //    CLASS FW_XWritableStreamFormatter
  630. //========================================================================================
  631.  
  632. _FW_EXCEPTION_IMPLEMENT(FW_XWritableStreamFormatter,
  633.                         FW_XPrivException)
  634.  
  635. //----------------------------------------------------------------------------------------
  636. //    FW_XWritableStreamFormatter::FW_XWritableStreamFormatter
  637. //----------------------------------------------------------------------------------------
  638.  
  639. FW_XWritableStreamFormatter::FW_XWritableStreamFormatter(long itemsRequested,
  640.                                                          long itemSize,
  641.                                                          long itemsWritten) :
  642.     FW_XPrivException(),
  643.     fItemsRequested(itemsRequested),
  644.     fItemSize(itemSize),
  645.     fItemsWritten(itemsWritten)
  646. {
  647. }
  648.  
  649. //----------------------------------------------------------------------------------------
  650. //    FW_XWritableStreamFormatter::FW_XWritableStreamFormatter
  651. //----------------------------------------------------------------------------------------
  652.  
  653. FW_XWritableStreamFormatter::FW_XWritableStreamFormatter(const FW_XWritableStreamFormatter& formatter) :
  654.     FW_XPrivException(),
  655.     fItemsRequested(formatter.fItemsRequested),
  656.     fItemSize(formatter.fItemSize),
  657.     fItemsWritten(formatter.fItemsWritten
  658. )
  659. {
  660. }
  661.  
  662. //----------------------------------------------------------------------------------------
  663. //    FW_XWritableStreamFormatter::~FW_XWritableStreamFormatter
  664. //----------------------------------------------------------------------------------------
  665.  
  666. FW_XWritableStreamFormatter::~FW_XWritableStreamFormatter()
  667. {
  668. }
  669.