Welcome to mirror list, hosted at ThFree Co, Russian Federation.

TracySourceContents.hpp « server - github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e0b668fe654ea3ab341dcf522368e713dc6b162f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef __TRACYSOURCECONTENTS_HPP__
#define __TRACYSOURCECONTENTS_HPP__

#include <stdint.h>
#include <stddef.h>
#include <vector>

#include "TracySourceTokenizer.hpp"

namespace tracy
{

class View;
class Worker;

class SourceContents
{
public:
    SourceContents();
    ~SourceContents();

    void Parse( const char* fileName, const Worker& worker, const View& view );

    const std::vector<Tokenizer::Line>& get() const { return m_lines; }
    bool empty() const { return m_lines.empty(); }

    const char* filename() const { return m_file; }
    uint32_t idx() const { return m_fileStringIdx; }
    bool is_cached() const { return m_data != m_dataBuf; }

private:
    const char* m_file;
    uint32_t m_fileStringIdx;

    const char* m_data;
    char* m_dataBuf;
    size_t m_dataSize;

    std::vector<Tokenizer::Line> m_lines;
};

}

#endif