ByteSwap.hh 1.02 KB
Newer Older
Will Schroeder's avatar
Will Schroeder committed
1
2
/*=========================================================================

Ken Martin's avatar
Ken Martin committed
3
  Program:   Visualization Toolkit
Will Schroeder's avatar
Will Schroeder committed
4
5
6
7
8
  Module:    ByteSwap.hh
  Language:  C++
  Date:      $Date$
  Version:   $Revision$

Ken Martin's avatar
Ken Martin committed
9
This file is part of the Visualization Toolkit. No part of this file
Will Schroeder's avatar
Will Schroeder committed
10
11
12
13
14
15
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 

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

Ken Martin's avatar
Ken Martin committed
23
24
#ifndef __vtkByteSwap_hh
#define __vtkByteSwap_hh
Will Schroeder's avatar
Will Schroeder committed
25

Ken Martin's avatar
Ken Martin committed
26
class vtkByteSwap
Will Schroeder's avatar
Will Schroeder committed
27
28
{
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