swh:1:snp:f50ab94432af916b5fb8b4ad831e8dddded77084
Raw File
Tip revision: 4f4bc17f89f4ca955e3d30237b82452e42ca56a2 authored by Alona Kharchenko on 21 December 2016, 16:05:37 UTC
bug fix
Tip revision: 4f4bc17
TextReaderConstants.h
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.md file in the project root for full license information.
//

#pragma once

namespace Microsoft { namespace MSR { namespace CNTK {

    const char SPACE_CHAR = ' ';
    const char TAB_CHAR = '\t';

    const char NAME_PREFIX = '|';
    
    const char INDEX_DELIMITER = ':';

    const char ROW_DELIMITER = '\n';
    
    const char ESCAPE_SYMBOL = '#';

    const auto BUFFER_SIZE = 2 * 1024 * 1024;

    inline bool isPrintable(char c)
    {
        return c >= SPACE_CHAR;
    }

    inline bool isNonPrintable(char c)
    {
        return !isPrintable(c);
    }

    inline bool isValueDelimiter(char c)
    {
        return c == SPACE_CHAR || c == TAB_CHAR;
    }

    inline bool isColumnDelimiter(char c)
    {
        return isValueDelimiter(c) || (isNonPrintable(c) && c != ROW_DELIMITER);
    }

}}}
back to top