File: dotest.cpp

package info (click to toggle)
dpuser 4.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 12,632 kB
  • sloc: cpp: 121,623; ansic: 6,866; lex: 1,113; makefile: 747; yacc: 741; sh: 78
file content (29 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (4)
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
#include "osdir.h"

#include <iostream>

int main()
{
	std::cout << "Current directory" << std::endl;
	oslink::directory cwd(".");
	while (cwd)
		std::cout << " " << cwd.next() << std::endl;

	std::cout << "Regular file" << std::endl;
	oslink::directory reg("test.cc");
	while (reg)
		std::cout << " " << reg.next() << std::endl;

	std::cout << "Non existant file" << std::endl;
	oslink::directory non("nonexistant");
	while (non)
		std::cout << " " << non.next() << std::endl;

	std::cout << "C:\\WINDOWS" << std::endl;
	oslink::directory etc("C:\\WINDOWS");
	while (etc)
		std::cout << " " << etc.next() << std::endl;

	std::cout << "That's it" << std::endl;
	return 0;
}