otbVectorDataIOBase.cxx 1.58 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*
 * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
 *
 * This file is part of Orfeo Toolbox
 *
 *     https://www.orfeo-toolbox.org/
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
Thomas Feuvrier's avatar
Thomas Feuvrier committed
20

21
#include <ostream>
22

Thomas Feuvrier's avatar
Thomas Feuvrier committed
23 24 25 26
#include "otbVectorDataIOBase.h"

namespace otb
{
27
VectorDataIOBase
Julien Michel's avatar
Julien Michel committed
28
::VectorDataIOBase() :
OTB Bot's avatar
STYLE  
OTB Bot committed
29
  m_ByteOrder(OrderNotApplicable)
Thomas Feuvrier's avatar
Thomas Feuvrier committed
30
{
31
  this->Reset(false);
Thomas Feuvrier's avatar
Thomas Feuvrier committed
32 33
}

Julien Michel's avatar
Julien Michel committed
34
void
35
VectorDataIOBase
Julien Michel's avatar
Julien Michel committed
36
::Reset(const bool)
Thomas Feuvrier's avatar
Thomas Feuvrier committed
37 38 39 40 41
{
  m_Initialized = false;
  m_FileName = "";
}

42 43

VectorDataIOBase
Julien Michel's avatar
Julien Michel committed
44
::~VectorDataIOBase()
45
{}
Thomas Feuvrier's avatar
Thomas Feuvrier committed
46

Julien Michel's avatar
Julien Michel committed
47
std::string
48
VectorDataIOBase
Julien Michel's avatar
Julien Michel committed
49
::GetByteOrderAsString(ByteOrder t) const
Thomas Feuvrier's avatar
Thomas Feuvrier committed
50 51
{
  std::string s;
52
  switch (t)
OTB Bot's avatar
STYLE  
OTB Bot committed
53
    {
OTB Bot's avatar
STYLE  
OTB Bot committed
54 55 56 57 58 59 60
    case BigEndian:
      return s = "BigEndian";
    case LittleEndian:
      return s = "LittleEndian";
    case OrderNotApplicable:
    default:
      return s = "OrderNotApplicable";
OTB Bot's avatar
STYLE  
OTB Bot committed
61
    }
Thomas Feuvrier's avatar
Thomas Feuvrier committed
62 63
}

64
void
65
VectorDataIOBase
Julien Michel's avatar
Julien Michel committed
66
::PrintSelf(std::ostream& os, itk::Indent indent) const
Thomas Feuvrier's avatar
Thomas Feuvrier committed
67 68 69 70 71 72 73 74
{
  Superclass::PrintSelf(os, indent);

  os << indent << "FileName: " << m_FileName << std::endl;
  os << indent << "ByteOrder: " << this->GetByteOrderAsString(m_ByteOrder) << std::endl;
}

} //namespace otb