gfx/angle/src/compiler/preprocessor/Input.h

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

     1 //
     2 // Copyright (c) 2011 The ANGLE Project Authors. All rights reserved.
     3 // Use of this source code is governed by a BSD-style license that can be
     4 // found in the LICENSE file.
     5 //
     7 #ifndef COMPILER_PREPROCESSOR_INPUT_H_
     8 #define COMPILER_PREPROCESSOR_INPUT_H_
    10 #include <stddef.h>
    11 #include <vector>
    13 namespace pp
    14 {
    16 // Holds and reads input for Lexer.
    17 class Input
    18 {
    19   public:
    20     Input();
    21     Input(size_t count, const char* const string[], const int length[]);
    23     size_t count() const { return mCount; }
    24     const char* string(size_t index) const { return mString[index]; }
    25     size_t length(size_t index) const { return mLength[index]; }
    27     size_t read(char* buf, size_t maxSize);
    29     struct Location
    30     {
    31         size_t sIndex;  // String index;
    32         size_t cIndex;  // Char index.
    34         Location() : sIndex(0), cIndex(0) { }
    35     };
    36     const Location& readLoc() const { return mReadLoc; }
    38   private:
    39     // Input.
    40     size_t mCount;
    41     const char* const* mString;
    42     std::vector<size_t> mLength;
    44     Location mReadLoc;
    45 };
    47 }  // namespace pp
    48 #endif  // COMPILER_PREPROCESSOR_INPUT_H_

mercurial