Subversion Repositories DevTools

Rev

Rev 2218 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2218 Rev 2222
Line 34... Line 34...
34
#include "TransactionStream.h"
34
#include "TransactionStream.h"
35
// UdFileManifest
35
// UdFileManifest
36
#include "UdFileManifest.h"
36
#include "UdFileManifest.h"
37
//## begin module%4209BA4C03B8.additionalDeclarations preserve=yes
37
//## begin module%4209BA4C03B8.additionalDeclarations preserve=yes
38
 
38
 
-
 
39
#include <ctype>
39
/**
40
/**
40
	Example UD Manifest file.  Lines starting with a # are comments and are
41
	Example UD Manifest file.  Lines starting with a # are comments and are
41
	ignored.
42
	ignored.
42
	
43
 
43
	#UD Manifest
44
	#UD Manifest
44
	#0000000101-SY1-903ECU-00000005
45
	#0000000101-SY1-903ECU-00000005
45
	/afc/ergdce/var/DCE/ud/drained/CvXK71l0_903ECU.devud
46
	/afc/ergdce/var/DCE/ud/drained/CvXK71l0_903ECU.devud
46
	/afc/ergdce/var/DCE/ud/drained/CvXLn1Y0_903ECU.devud
47
	/afc/ergdce/var/DCE/ud/drained/CvXLn1Y0_903ECU.devud
47
	/afc/ergdce/var/DCE/ud/drained/CvXP49b0_903ECU.devud
48
	/afc/ergdce/var/DCE/ud/drained/CvXP49b0_903ECU.devud
Line 92... Line 93...
92
//## Operation: addUdFile%4209BAC703E7
93
//## Operation: addUdFile%4209BAC703E7
93
void UdFileManifest::addUdFile (const std::string &file)
94
void UdFileManifest::addUdFile (const std::string &file)
94
{
95
{
95
  //## begin UdFileManifest::addUdFile%4209BAC703E7.body preserve=yes
96
  //## begin UdFileManifest::addUdFile%4209BAC703E7.body preserve=yes
96
 
97
 
-
 
98
	// TODO: specify a pathmap to replace the filepath.  For now, we just strip
-
 
99
	// any drive specification an cannonise the path.
-
 
100
 
-
 
101
	std::string cannonised;
-
 
102
	char const * p = const_cast< char * >( file.c_str() );
-
 
103
 
-
 
104
	// check if drive letter at start of filename
97
	if ( file.length() )
105
	if ( file.length() >= 3
-
 
106
			&& isalpha( file[ 0 ] ) != 0			// a-z or A-Z
-
 
107
			&& file[ 1 ] == ':' )					// :
-
 
108
	{
-
 
109
		p += 2;
-
 
110
	}
-
 
111
	while ( *p )
-
 
112
	{
-
 
113
		if ( *p != '\\' )
-
 
114
		{
-
 
115
			cannonised += *p;
-
 
116
		}
-
 
117
		else
-
 
118
		{
-
 
119
			cannonised += '/';
-
 
120
		}
-
 
121
		++p;
-
 
122
	}
-
 
123
 
-
 
124
	if ( cannonised.length() )
98
	{
125
	{
99
		(*m_stream) << file << std::endl;
126
		(*m_stream) << cannonised << std::endl;
100
		++m_count;
127
		++m_count;
101
	}
128
	}
102
 
129
 
103
  //## end UdFileManifest::addUdFile%4209BAC703E7.body
130
  //## end UdFileManifest::addUdFile%4209BAC703E7.body
104
}
131
}