#include "idep_aliasdep.h"#include "idep_namearray.h"#include "idep_nameindexmap.h"#include "idep_filedepiter.h"#include "idep_tokeniter.h"#include "idep_aliastable.h"#include "idep_aliasutil.h"#include <ctype.h>#include <cstring>#include <fstream>#include <memory>#include <iostream>#include <cassert>Go to the source code of this file.
Classes | |
| class | idep_AliasDepIntArray |
| class | idep_AliasDepString |
| struct | idep_AliasDep_i |
Typedefs | |
| typedef void(idep_AliasDep::* | Func )(const char *) |
Functions | |
| std::ostream & | warn (std::ostream &ing) |
| std::ostream & | err (std::ostream &orr) |
| const char * | stripDir (const char *s) |
| int | isAsciiFile (const char *fileName) |
| void | loadFromStream (std::istream &in, idep_AliasDep *dep, Func add) |
| int | loadFromFile (const char *file, idep_AliasDep *dep, Func add) |
| char * | newStrCpy (const char *name) |
| char * | removeSuffix (char *dirPath) |
| void | zero (idep_AliasDepIntArray *a) |
| const char * | th (int n) |
|
|
Definition at line 68 of file idep_adep.cxx. |
|
|
Definition at line 24 of file idep_adep.cxx. 00025 {
00026 return orr << "Error: ";
00027 }
|
|
|
Definition at line 50 of file idep_adep.cxx. 00051 {
00052 enum { NO = 0, YES = 1 };
00053 std::ifstream in(fileName);
00054 if (!in) {
00055 return NO;
00056 }
00057
00058 // check for non-ascii characters
00059 char c;
00060 while (in && !in.get(c).eof()) {
00061 if (!isascii(c)) {
00062 return NO;
00063 }
00064 }
00065 return YES;
00066 }
|
|
||||||||||||||||
|
Definition at line 85 of file idep_adep.cxx. References BAD, GOOD, isAsciiFile(), and loadFromStream(). 00086 {
00087 enum { BAD = -1, GOOD = 0 };
00088 if (!isAsciiFile(file)) {
00089 return BAD;
00090 }
00091 std::ifstream in(file);
00092 assert(in);
00093 loadFromStream(in, dep, add);
00094 return GOOD;
00095 }
|
|
||||||||||||||||
|
Definition at line 69 of file idep_adep.cxx. 00070 {
00071 assert(in);
00072 for (idep_TokenIter it(in); it; ++it) {
00073 if ('#' == *it()) { // strip comment if any
00074 while (it && '\n' != *it()) {
00075 ++it;
00076 }
00077 continue; // either !it or '\n'
00078 }
00079 if ('\n' != *it()) {
00080 (dep->*add)(it());
00081 }
00082 }
00083 }
|
|
|
Definition at line 97 of file idep_adep.cxx. Referenced by idep_AliasDepString::idep_AliasDepString(). 00098 {
00099 int size = strlen(name) + 1;
00100 char *buf = new char[size];
00101 memcpy(buf, name, size);
00102 return buf;
00103 }
|
|
|
Definition at line 105 of file idep_adep.cxx. 00106 {
00107 char *dot = strrchr(dirPath, '.');
00108 if (dot && !strchr(dot, '/')) { // if '.' found in final path segment
00109 dot[0] = '\0'; // eliminate suffix ("a/.b" -> "a/")
00110 }
00111 return dirPath;
00112 }
|
|
|
Definition at line 41 of file idep_adep.cxx. References s(). Referenced by idep_AliasDep::extract(), and idep_AliasDep::verify(). 00042 {
00043 if (s) {
00044 const char *slash = strrchr(s, '/');
00045 return slash ? slash + 1 : s;
00046 }
00047 return s; // input was null
00048 }
|
|
|
Definition at line 305 of file idep_adep.cxx. Referenced by idep_AliasDep::verify(). 00306 {
00307 return 1 == n ? "st" : 2 == n ? "nd" : 3 == n ? "rd" : "th";
00308 }
|
|
|
Definition at line 19 of file idep_adep.cxx. 00020 {
00021 return ing << "Warning: ";
00022 }
|
|
|
Definition at line 129 of file idep_adep.cxx. References idep_AliasDepIntArray::length(). Referenced by idep_AliasDep::extract(), and idep_AliasDep::unpaired(). 00130 {
00131 for (int i = 0; i < a->length(); ++i) {
00132 (*a)[i] = 0;
00133 }
00134 }
|
1.3.9.1