Point Cloud Library (PCL)  1.9.1
tar.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010-2012, Willow Garage, Inc.
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of the copyright holder(s) nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  */
37 
38 #ifndef PCL_IO_TAR_H_
39 #define PCL_IO_TAR_H_
40 
41 #include <pcl/point_cloud.h>
42 
43 namespace pcl
44 {
45  namespace io
46  {
47  /** \brief A TAR file's header, as described on
48  * http://en.wikipedia.org/wiki/Tar_%28file_format%29.
49  */
50  struct TARHeader
51  {
52  char file_name[100];
53  char file_mode[8];
54  char uid[8];
55  char gid[8];
56  char file_size[12];
57  char mtime[12];
58  char chksum[8];
59  char file_type[1];
60  char link_file_name[100];
61  char ustar[6];
62  char ustar_version[2];
63  char uname[32];
64  char gname[32];
65  char dev_major[8];
66  char dev_minor[8];
67  char file_name_prefix[155];
68  char _padding[12];
69 
70  /** \brief get file size */
71  unsigned int
73  {
74  unsigned int output = 0;
75  char *str = file_size;
76  for (int i = 0; i < 11; i++)
77  {
78  output = output * 8 + *str - '0';
79  str++;
80  }
81  return (output);
82  }
83  };
84 
85  /** \brief Save a PointCloud dataset into a TAR file.
86  * Append if the file exists, or create a new one if not.
87  * \remark till implemented will return FALSE
88  */
89  // param[in] tar_filename the name of the TAR file to save the cloud to
90  // param[in] cloud the point cloud dataset to save
91  // param[in] pcd_filename the internal name of the PCD file that should be stored in the TAR header
92  template <typename PointT> bool
93  saveTARPointCloud (const std::string& /*tar_filename*/,
94  const PointCloud<PointT>& /*cloud*/,
95  const std::string& /*pcd_filename*/)
96  {
97  return (false);
98  }
99  }
100 }
101 #endif // PCL_IO_TAR_H_
102 
pcl::io::TARHeader::uid
char uid[8]
Definition: tar.h:54
pcl::io::TARHeader
A TAR file's header, as described on http://en.wikipedia.org/wiki/Tar_%28file_format%29.
Definition: tar.h:50
pcl
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
pcl::io::TARHeader::file_name_prefix
char file_name_prefix[155]
Definition: tar.h:67
pcl::io::TARHeader::dev_minor
char dev_minor[8]
Definition: tar.h:66
pcl::io::TARHeader::file_mode
char file_mode[8]
Definition: tar.h:53
pcl::io::TARHeader::uname
char uname[32]
Definition: tar.h:63
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: projection_matrix.h:53
pcl::io::saveTARPointCloud
bool saveTARPointCloud(const std::string &, const PointCloud< PointT > &, const std::string &)
Save a PointCloud dataset into a TAR file.
Definition: tar.h:93
pcl::io::TARHeader::link_file_name
char link_file_name[100]
Definition: tar.h:60
pcl::io::TARHeader::file_size
char file_size[12]
Definition: tar.h:56
pcl::io::TARHeader::gid
char gid[8]
Definition: tar.h:55
pcl::io::TARHeader::ustar
char ustar[6]
Definition: tar.h:61
pcl::io::TARHeader::mtime
char mtime[12]
Definition: tar.h:57
pcl::io::TARHeader::chksum
char chksum[8]
Definition: tar.h:58
pcl::io::TARHeader::file_name
char file_name[100]
Definition: tar.h:52
pcl::io::TARHeader::file_type
char file_type[1]
Definition: tar.h:59
pcl::io::TARHeader::dev_major
char dev_major[8]
Definition: tar.h:65
pcl::io::TARHeader::getFileSize
unsigned int getFileSize()
get file size
Definition: tar.h:72
pcl::io::TARHeader::gname
char gname[32]
Definition: tar.h:64
pcl::io::TARHeader::_padding
char _padding[12]
Definition: tar.h:68
pcl::io::TARHeader::ustar_version
char ustar_version[2]
Definition: tar.h:62