]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/textfile.h
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 **********************************************************************
5 * Copyright (c) 2004-2011, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
9 * Created: March 19 2004
11 **********************************************************************
13 #ifndef __ICU_INTLTEST_TEXTFILE__
14 #define __ICU_INTLTEST_TEXTFILE__
20 * This class implements access to a text data file located in the
21 * icu/source/test/testdata/ directory.
26 * Open a file with the given name, in the given encoding, in the
27 * ICU testdata directory. See textfile.cpp to determine if the
28 * 'name' and 'encoding' parameters are aliased or copied.
30 TextFile(const char* name
, const char* encoding
, UErrorCode
& ec
);
35 * Read a line terminated by ^J or ^M or ^M^J, and convert it from
36 * this file's encoding to Unicode. The EOL character(s) are not
38 * @return TRUE if a line was read, or FALSE if the EOF
39 * was reached or an error occurred
41 UBool
readLine(UnicodeString
& line
, UErrorCode
& ec
);
44 * Read a line, ignoring blank lines and lines that start with
45 * '#'. Trim leading white space.
46 * @param trim if TRUE then remove leading Pattern_White_Space
47 * @return TRUE if a line was read, or FALSE if the EOF
48 * was reached or an error occurred
50 UBool
readLineSkippingComments(UnicodeString
& line
, UErrorCode
& ec
,
54 * Return the line number of the last line returned by readLine().
56 inline int32_t getLineNumber() const;
59 UBool
ensureCapacity(int32_t capacity
);
60 UBool
setBuffer(int32_t index
, char c
, UErrorCode
& ec
);
70 inline int32_t TextFile::getLineNumber() const {