File: FindComPorts.h

package info (click to toggle)
urg 0.8.11-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,212 kB
  • ctags: 1,605
  • sloc: sh: 10,014; cpp: 6,459; ansic: 2,419; makefile: 203
file content (84 lines) | stat: -rw-r--r-- 1,693 bytes parent folder | download | duplicates (2)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef QRK_FIND_COM_PORTS_H
#define QRK_FIND_COM_PORTS_H

/*!
  \file
  \brief COM |[gꗗ̎擾

  \author Satofumi KAMIMURA

  $Id: FindComPorts.h 1576 2009-12-15 00:40:56Z satofumi $

  \attention mF Windows XP ̂݁Bł͖
*/

#include <string>
#include <vector>
#include <memory>


namespace qrk
{
  /*!
    \brief VA|[g̒Ts

    Windows ł́AWXg COM ꗗ擾ĕԂB\n
    Linux, MacOS ł́A^ꂽp^[Ɉvt@C擾ĕԂB
  */
  class FindComPorts
  {
  public:
    FindComPorts(void);
    ~FindComPorts(void);


    /*!
      \brief o^ς݂̃x[X̃NA
    */
    void clearBaseNames(void);


    /*!
      \brief Tŗp|[g̃x[Xlj

      \param[in] base_name |[g̃x[X
    */
    void addBaseName(const char* base_name);


    /*!
      \brief o^ς݂̃|[g̃x[XԂ

      Linux ŗp

      \return |[g̃x[X
    */
    std::vector<std::string> baseNames(void);


    void addDriverName(const char* driver_name);


    /*!
      \brief COM |[gꗗ̎擾

      \param[out] ports o|[g
      \param[in] all_ports addDriverName() Ŏw肵|[ĝݎ擾Ƃ false

      \retval COM ꗗi[ꂽ string z
    */
    size_t find(std::vector<std::string>& ports, bool all_ports = true);

    size_t find(std::vector<std::string>& ports,
                std::vector<std::string>& driver_names, bool all_ports = true);

  private:
    FindComPorts(const FindComPorts& rhs);
    FindComPorts& operator = (const FindComPorts& rhs);

    struct pImpl;
    std::auto_ptr<pImpl> pimpl;
  };
}

#endif /* !QRK_FIND_COM_PORTS_H */