Back to index

lshw  02.16
Classes | Enumerations | Functions
hw Namespace Reference

Classes

struct  resource_i
struct  value_i
class  resource
class  value

Enumerations

enum  hwClass {
  system, bridge, memory, processor,
  address, storage, disk, tape,
  bus, network, display, input,
  printer, multimedia, communication, power,
  volume, generic
}
enum  hwResourceType {
  none, iomem, ioport, mem,
  irq, dma
}
enum  hwValueType { nil, boolean, integer, text }

Functions

string strip (const string &)
string asString (long)
string reportSize (unsigned long long)

Class Documentation

struct hw::resource_i

Definition at line 1979 of file hw.cc.

Class Members
bool b
int refcount
hwResourceType type
unsigned int ui1
unsigned long ul1
unsigned long ul2
unsigned long long ull1
unsigned long long ull2
struct hw::value_i

Definition at line 2216 of file hw.cc.

Collaboration diagram for hw::value_i:
Class Members
bool b
long long ll
int refcount
string s
hwValueType type

Enumeration Type Documentation

Enumerator:
system 
bridge 
memory 
processor 
address 
storage 
disk 
tape 
bus 
network 
display 
input 
printer 
multimedia 
communication 
power 
volume 
generic 

Definition at line 12 of file hw.h.

Enumerator:
none 
iomem 
ioport 
mem 
irq 
dma 

Definition at line 34 of file hw.h.

Enumerator:
nil 
boolean 
integer 
text 

Definition at line 36 of file hw.h.


Function Documentation

string hw::asString ( long  n)

Definition at line 74 of file hw.cc.

{
  char buffer[256];

  snprintf(buffer, sizeof(buffer), "%ld", n);
  return string(buffer);
}

Here is the caller graph for this function:

string hw::reportSize ( unsigned long  long)
string hw::strip ( const string &  s)

Definition at line 49 of file hw.cc.

{
  string result = s;
  size_t i = result.find('\0');

  if(i != string::npos)
    result = result.substr(0, i);

  while ((result.length() > 0) && ((uint8_t)result[0] <= ' '))
    result.erase(0, 1);
  while ((result.length() > 0) && ((uint8_t)result[result.length() - 1] <= ' '))
    result.erase(result.length() - 1);

  for (i = 0; i < result.length(); i++)
    if ((uint8_t)result[i] < ' ')
    {
      result.erase(i, 1);
      i--;
    }

  result = utf8_sanitize(result);

  return result;
}

Here is the call graph for this function: