home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / librw / RWeostream.z / RWeostream
Encoding:
Text File  |  1998-10-30  |  15.5 KB  |  397 lines

  1.  
  2.  
  3.  
  4. RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm((((3333CCCC++++++++))))                                              RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm((((3333CCCC++++++++))))
  5.  
  6.  
  7.  
  8. NNNNaaaammmmeeee
  9.      RWeostream - Rogue Wave library class
  10.  
  11. SSSSyyyynnnnooooppppssssiiiissss
  12.               #include <rw/estream.h>
  13.  
  14.  
  15.  
  16.               // Construct an RWeostream that uses cout's streambuf,
  17.           //   and writes out values in little-endian format:
  18.           RWeostream estr(cout, RWeostream::LittleEndian);
  19.  
  20.  
  21.  
  22.  
  23. DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
  24.      Class RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm specializes the base class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm to store values in
  25.      a portable binary format.  The results can be restored via its
  26.      counterpart, RRRRWWWWeeeeiiiissssttttrrrreeeeaaaammmm.  See the entry for RRRRWWWWeeeeiiiissssttttrrrreeeeaaaammmm for a general
  27.      description of the endian stream classes.
  28.  
  29. PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
  30.      None.
  31.  
  32. EEEExxxxaaaammmmpppplllleeee
  33.      See RRRRWWWWeeeeiiiissssttttrrrreeeeaaaammmm for an example of how the file "ddddaaaattttaaaa....ddddaaaatttt" might be read.
  34.  
  35. EEEEnnnnuuuummmmeeeerrrraaaattttiiiioooonnnn
  36.               eeeennnnuuuummmm RWeostream::Endian { LittleEndian,
  37.                                     BigEndian,
  38.                                     HostEndian }
  39.  
  40.  
  41.      Used to specify the format that RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmms should use to represent
  42.      numeric values in the stream.  HHHHoooossssttttEEEEnnnnddddiiiiaaaannnn means to use the native format
  43.      of the current environment.
  44.  
  45. PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss
  46.               RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm(streambuf* s, Endian fmt = HostEndian);
  47.  
  48.  
  49.      Construct an RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm from the ssssttttrrrreeeeaaaammmmbbbbuuuuffff ssss.  Values placed into the
  50.      stream will have an endian format given by ffffmmmmtttt.  For DOS, the ssssttttrrrreeeeaaaammmmbbbbuuuuffff
  51.      must have been created in binary mode.  Throw exception RRRRWWWWSSSSttttrrrreeeeaaaammmmEEEErrrrrrrr if
  52.      ssssttttrrrreeeeaaaammmmbbbbuuuuffff ssss is not empty.
  53.  
  54.               RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm(ostream& str, Endian fmt = HostEndian);
  55.  
  56.  
  57.      Construct an RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm from the ssssttttrrrreeeeaaaammmmbbbbuuuuffff associated with the output
  58.      stream ssssttttrrrr.  Values placed into the stream will have an endian format
  59.      given by ffffmmmmtttt.  For DOS, the ssssttttrrrr must have been opened in binary mode.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm((((3333CCCC++++++++))))                                              RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm((((3333CCCC++++++++))))
  71.  
  72.  
  73.  
  74.      Throw exception RRRRWWWWSSSSttttrrrreeeeaaaammmmEEEErrrrrrrr if ssssttttrrrreeeeaaaammmmbbbbuuuuffff ssss is not empty.
  75.  
  76. PPPPuuuubbbblllliiiicccc DDDDeeeessssttttrrrruuuuccccttttoooorrrr
  77.               virtual ~~~~RRRRWWWWvvvvoooossssttttrrrreeeeaaaammmm();
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.      This virtual destructor allows specializing classes to deallocate any
  85.      resources that they may have allocated.
  86.  
  87.  
  88.  
  89.  
  90.  
  91. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
  92.               virtual RWvostream&
  93.           fffflllluuuusssshhhh();
  94.  
  95.  
  96.      Send the contents of the stream buffer to output immediately.
  97.  
  98.               virtual RWvostream&
  99.           ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<(const char* s);
  100.  
  101.  
  102.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the character string starting at
  103.      ssss to the output stream.  The character string is expected to be null
  104.      terminated.  Note that the elements of s are treated as characters, not
  105.      as numbers.
  106.  
  107.               virtual RWvostream&
  108.           ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<(char c);
  109.  
  110.  
  111.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the cccchhhhaaaarrrr cccc to the output stream.
  112.      Note that cccc is treated as a character, not a number.
  113.  
  114.               virtual RWvostream&
  115.           ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<(wchar_t wc);
  116.  
  117.  
  118.      Redefined from class RWbostream.  Store the wwwwcccchhhhaaaarrrr____tttt wwwwcccc to the output
  119.      stream in binary, using the appropriate endian representation.
  120.  
  121.               virtual RWvostream&
  122.           ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<(unsigned char c);
  123.  
  124.  
  125.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr cccc to the output
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm((((3333CCCC++++++++))))                                              RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm((((3333CCCC++++++++))))
  137.  
  138.  
  139.  
  140.      stream.  Note that cccc is treated as a character, not a number.
  141.  
  142.               virtual RWvostream&
  143.           ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<(double d);
  144.  
  145.  
  146.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the ddddoooouuuubbbblllleeee dddd to the output stream
  147.      in binary, using the appropriate endian representation.
  148.  
  149.               virtual RWvostream&
  150.           ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<(float f);
  151.  
  152.  
  153.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the ffffllllooooaaaatttt ffff to the output stream
  154.      in binary, using the appropriate endian representation.
  155.  
  156.               virtual RWvostream&
  157.           ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<(int i);
  158.  
  159.  
  160.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the iiiinnnntttt iiii to the output stream in
  161.      binary, using the appropriate endian representation.
  162.  
  163.               virtual RWvostream&
  164.           ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<(unsigned int i);
  165.  
  166.  
  167.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the uuuunnnnssssiiiiggggnnnneeeedddd iiiinnnntttt iiii to the output
  168.      stream in binary, using the appropriate endian representation.
  169.  
  170.               virtual RWvostream&
  171.           ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<(long l);
  172.  
  173.  
  174.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the lllloooonnnngggg llll to the output stream
  175.      in binary, using the appropriate endian representation.
  176.  
  177.               virtual RWvostream&
  178.           ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<(unsigned long l);
  179.  
  180.  
  181.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the uuuunnnnssssiiiiggggnnnneeeedddd lllloooonnnngggg llll to the output
  182.      stream in binary, using the appropriate endian representation.
  183.  
  184.               virtual RWvostream&
  185.           ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<(short s);
  186.  
  187.  
  188.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the sssshhhhoooorrrrtttt ssss to the output stream
  189.      in binary, using the appropriate endian representation.
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm((((3333CCCC++++++++))))                                              RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm((((3333CCCC++++++++))))
  203.  
  204.  
  205.  
  206.               virtual RWvostream&
  207.           ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<(unsigned short s);
  208.  
  209.  
  210.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the uuuunnnnssssiiiiggggnnnneeeedddd sssshhhhoooorrrrtttt ssss to the
  211.      output stream in binary, using the appropriate endian representation.
  212.  
  213.               virtual RWvostream&
  214.           ppppuuuutttt(char c);
  215.           virtual RWvostream&
  216.           ppppuuuutttt(unsigned char c);
  217.           virtual RWvostream&
  218.           ppppuuuutttt(const char* p, size_t N);
  219.  
  220.  
  221.      Inherited from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.
  222.  
  223.               virtual RWvostream&
  224.           ppppuuuutttt(wchar_t wc);
  225.  
  226.  
  227.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the wcccchhhhaaaarrrr____tttt wwwwcccc to the output
  228.      stream in binary, using the appropriate endian representation.
  229.  
  230.               virtual RWvostream&
  231.           ppppuuuutttt(const wchar_t* p, size_t N);
  232.  
  233.  
  234.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the vector of wwwwcccchhhhaaaarrrr____tttts starting
  235.      at pppp to the output stream in binary, using the appropriate endian
  236.      representation.
  237.  
  238.               virtual RWvostream&
  239.           ppppuuuutttt(const unsigned char* p, size_t N);
  240.  
  241.  
  242.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the vector of uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrrs
  243.      starting at pppp to the output stream in binary, using the appropriate
  244.      endian representation.
  245.  
  246.               virtual RWvostream&
  247.           ppppuuuutttt(const short* p, size_t N);
  248.  
  249.  
  250.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the vector of sssshhhhoooorrrrtttts starting at
  251.      pppp to the output stream in binary, using the appropriate endian
  252.      representation.
  253.  
  254.               virtual RWvostream&
  255.           ppppuuuutttt(const unsigned short* p, size_t N);
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm((((3333CCCC++++++++))))                                              RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm((((3333CCCC++++++++))))
  269.  
  270.  
  271.  
  272.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the vector of uuuunnnnssssiiiiggggnnnneeeedddd sssshhhhoooorrrrtttts
  273.      starting at pppp to the output stream in binary, using the appropriate
  274.      endian representation.
  275.  
  276.               virtual RWvostream&
  277.           ppppuuuutttt(const int* p, size_t N);
  278.  
  279.  
  280.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the vector of iiiinnnntttts starting at pppp
  281.      to the output stream in binary, using the appropriate endian
  282.      representation.
  283.  
  284.               virtual RWvostream&
  285.           ppppuuuutttt(const unsigned int* p, size_t N);
  286.  
  287.  
  288.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the vector of uuuunnnnssssiiiiggggnnnneeeedddd iiiinnnntttts
  289.      starting at pppp to the output stream in binary, using the appropriate
  290.      endian representation.
  291.  
  292.               virtual RWvostream&
  293.           ppppuuuutttt(const long* p, size_t N);
  294.  
  295.  
  296.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the vector of lllloooonnnnggggs starting at pppp
  297.      to the output stream in binary, using the appropriate endian
  298.      representation.
  299.  
  300.               virtual RWvostream&
  301.           ppppuuuutttt(const unsigned long* p, size_t N);
  302.  
  303.  
  304.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the vector of uuuunnnnssssiiiiggggnnnneeeedddd lllloooonnnnggggs
  305.      starting at pppp to the output stream in binary, using the appropriate
  306.      endian representation.
  307.  
  308.               virtual RWvostream&
  309.           ppppuuuutttt(const float* p, size_t N);
  310.  
  311.  
  312.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the vector of ffffllllooooaaaatttts starting at
  313.      pppp to the output stream in binary, using the appropriate endian
  314.      representation.
  315.  
  316.               virtual RWvostream&
  317.           ppppuuuutttt(const double* p, size_t N);
  318.  
  319.  
  320.      Redefined from class RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm.  Store the vector of ddddoooouuuubbbblllleeees starting at
  321.      pppp to the output stream in binary, using the appropriate endian
  322.      representation.
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm((((3333CCCC++++++++))))                                              RRRRWWWWeeeeoooossssttttrrrreeeeaaaammmm((((3333CCCC++++++++))))
  335.  
  336.  
  337.  
  338.               virtual RWvostream&
  339.           ppppuuuuttttSSSSttttrrrriiiinnnngggg(const char*s, size_t N);
  340.  
  341.  
  342.      Store the character string, iiiinnnncccclllluuuuddddiiiinnnngggg eeeemmmmbbbbeeeeddddddddeeeedddd nnnnuuuullllllllssss, starting at s to
  343.      the output string.
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.