OpenCores
URL https://opencores.org/ocsvn/riscv_vhdl/riscv_vhdl/trunk

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [libdbg64g/] [services/] [console/] [autocompleter.h] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 sergeykhbr
/*
2
 *  Copyright 2018 Sergey Khabarov, sergeykhbr@gmail.com
3
 *
4
 *  Licensed under the Apache License, Version 2.0 (the "License");
5
 *  you may not use this file except in compliance with the License.
6
 *  You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *  Unless required by applicable law or agreed to in writing, software
11
 *  distributed under the License is distributed on an "AS IS" BASIS,
12
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *  See the License for the specific language governing permissions and
14
 *  limitations under the License.
15 3 sergeykhbr
 */
16
 
17
#ifndef __DEBUGGER_AUTOCOMPLETER_H__
18
#define __DEBUGGER_AUTOCOMPLETER_H__
19
 
20
#include "iclass.h"
21
#include "iservice.h"
22
#include "coreservices/iautocomplete.h"
23
#include <string>
24
#include <stdarg.h>
25
 
26
namespace debugger {
27
 
28
class AutoCompleter : public IService,
29
                      public IAutoComplete {
30
public:
31
    explicit AutoCompleter(const char *name);
32
    virtual ~AutoCompleter();
33
 
34
    /** IService interface */
35
    virtual void postinitService();
36
 
37
    /** IAutoComplete */
38
    virtual bool processKey(uint32_t qt_key, AttributeType *cmd,
39
                            AttributeType *cursor);
40
 
41
 
42
private:
43
    void addToHistory(const char *cmd);
44
 
45
private:
46
    //AttributeType console_;
47
    AttributeType socInfo_;
48
    AttributeType history_;
49
    AttributeType history_size_;
50
 
51
    std::string cmdLine_;
52
    unsigned carretPos_;
53
 
54
    // History switching
55
    std::string unfinshedLine_; // store the latest whe we look through history
56
    unsigned history_idx_;
57
};
58
 
59
DECLARE_CLASS(AutoCompleter)
60
 
61
}  // namespace debugger
62
 
63
#endif  // __DEBUGGER_AUTOCOMPLETER_H__

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.