1 |
/*************************************************************************** |
/*************************************************************************** |
2 |
* * |
* * |
3 |
* Copyright (C) 2007, 2008 Grigor Iliev * |
* Copyright (C) 2007 - 2009 Grigor Iliev * |
4 |
* * |
* * |
5 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
6 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
152 |
if (Pattern.length() == 0) return; |
if (Pattern.length() == 0) return; |
153 |
|
|
154 |
if (IsRegex(Pattern)) { |
if (IsRegex(Pattern)) { |
155 |
|
#ifndef WIN32 |
156 |
Sql << " AND " << Col << " regexp ?"; |
Sql << " AND " << Col << " regexp ?"; |
157 |
|
#else |
158 |
|
for (int i = 0; i < Pattern.length(); i++) { |
159 |
|
if (Pattern.at(i) == '?') Pattern.at(i) = '_'; |
160 |
|
else if (Pattern.at(i) == '*') Pattern.at(i) = '%'; |
161 |
|
} |
162 |
|
Sql << " AND " << Col << " LIKE ?"; |
163 |
|
#endif |
164 |
Params.push_back(Pattern); |
Params.push_back(Pattern); |
165 |
return; |
return; |
166 |
} |
} |