PTextFile.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2018 Digital Barriers plc. All rights reserved.
3  * Contact: http://www.digitalbarriers.com/
4  *
5  * This file is part of the Papillon SDK.
6  *
7  * You can't use, modify or distribute any part of this file without
8  * the explicit written agreements of Digital Barriers.
9  */
10 
15 #pragma once
16 #include <PObject.h>
17 
18 PAPILLON_BEGIN_NAMESPACE
19 
20 class PStringList;
21 
27 class PAPILLON_API_CORE PTextFile : public PObject
28 {
29 public:
30 
36  static PResult ReadAll(const PString& filename, PTextFile& textFile);
37 
41  PTextFile();
42 
46  PTextFile(const PTextFile& other);
47 
51  virtual ~PTextFile();
52 
56  PTextFile& operator=(const PTextFile& other);
57 
61  const PString& GetFileName() const;
62 
66  papillon::int32 GetNumberOfLines() const;
67 
71  PString GetLine(papillon::int32 lineNumber) const;
72 
76  PStringList GetLine(papillon::int32 lineNumber, const PString& separator) const;
77 
81  const PStringList& GetLines() const;
82 
83 private:
84  PTextFile(const PString& filename);
85 };
86 
87 PAPILLON_END_NAMESPACE
The PString class provides an Unicode character strings.
Definition: PString.h:37
DEPRECATED, use PStringList::FromTextFile() instead; The PTextFile class can be used to read text fil...
Definition: PTextFile.h:27
The PResult class represents the result returned by most of Papillon functions; this class is used to...
Definition: PResult.h:159
The PObject class is the root class of all Papillon classes; all PObject behaves like shared referenc...
Definition: PObject.h:27
The PStringList class represents a list of PString; NOT thread-safe.
Definition: PStringList.h:26
Class PObject: the root class of all Papillon classes.
PObject & operator=(const PObject &obj)
Performs a shared copy of other to this object.
Definition: PObject.h:45