Files
cdev-1.7.2n/test/cdevCollection/remove5.cc
2022-12-13 12:44:04 +01:00

22 lines
841 B
C++
Executable File

#include <cdevCollection.h>
void main ( void )
{
/**************************************************************
* Attach to a defined cdevCollection device and then remove
* all devices that match the specified regular expression.
**************************************************************/
cdevCollection & cDevice1 = cdevCollection::attachRef("cDevice1");
cDevice1.removeRegexp("device?");
/**************************************************************
* Use the getList method to obtain the array of names that are
* currently stored in the cdevCollection and display them.
* Note that the list (not the list items) msut be deleted by
* the caller.
**************************************************************/
char ** list = cDevice1.getList();
for(char **s = list; *s!=NULL; s++) printf("%s\n", *s);
delete list;
}