ByteSwap.hh 1.02 KB
Newer Older
Will Schroeder's avatar
Will Schroeder committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*=========================================================================

  Program:   Visualization Library
  Module:    ByteSwap.hh
  Language:  C++
  Date:      $Date$
  Version:   $Revision$

This file is part of the Visualization Library. No part of this file
or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors.

Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994 

=========================================================================*/
Will Schroeder's avatar
Will Schroeder committed
16
17
18
19
20
21
22
// .NAME vlByteSwap - perform machine dependent byte swapping
// .SECTION Description
// vlByteSwap is used by other classes to perform machine dependent byte
// swapping. Byte swapping is often used when reading or writing binary 
// files.
// .EXAMPLE STLRead.cc

Will Schroeder's avatar
Will Schroeder committed
23
24
25
26
27
28
#ifndef __vlByteSwap_hh
#define __vlByteSwap_hh

class vlByteSwap
{
public:
Ken Martin's avatar
Ken Martin committed
29
30
31
32
  void Swap4(char *c);
  void Swap4(float *p) {Swap4((char *)p);};
  void Swap4(int *i) {Swap4((char *)i);};
  void Swap4(unsigned long *i) {Swap4((char *)i);};
Will Schroeder's avatar
Will Schroeder committed
33
34
35
};

#endif