blob: 941f90396d7798fce0365f4857e3447458fa9f43 [file] [log] [blame]
djasper7f663602013-03-20 09:53:23 +00001//===-- clang-format/ClangFormat.cpp - Clang format tool ------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9///
10/// \file
11/// \brief This file implements a clang-format tool that automatically formats
12/// (fragments of) C++ code.
13///
14//===----------------------------------------------------------------------===//
15
16#include "clang/Basic/Diagnostic.h"
17#include "clang/Basic/DiagnosticOptions.h"
18#include "clang/Basic/FileManager.h"
19#include "clang/Basic/SourceManager.h"
nico436d02f2014-01-07 16:27:35 +000020#include "clang/Basic/Version.h"
djasper7f663602013-03-20 09:53:23 +000021#include "clang/Format/Format.h"
djasper44bf2ae2015-09-30 13:59:29 +000022#include "clang/Rewrite/Core/Rewriter.h"
djasper1e1687b2014-10-29 22:42:53 +000023#include "llvm/Support/CommandLine.h"
djasper7f663602013-03-20 09:53:23 +000024#include "llvm/Support/FileSystem.h"
25#include "llvm/Support/Signals.h"
26
27using namespace llvm;
djasper578d2032015-09-23 08:30:47 +000028using clang::tooling::Replacements;
djasper7f663602013-03-20 09:53:23 +000029
30static cl::opt<bool> Help("h", cl::desc("Alias for -help"), cl::Hidden);
31
alexfh725a9f72013-05-10 18:12:00 +000032// Mark all our options with this category, everything else (except for -version
33// and -help) will be hidden.
alexfhebc16002014-02-05 13:42:43 +000034static cl::OptionCategory ClangFormatCategory("Clang-format options");
djasper7f663602013-03-20 09:53:23 +000035
alexfh725a9f72013-05-10 18:12:00 +000036static cl::list<unsigned>
37 Offsets("offset",
38 cl::desc("Format a range starting at this byte offset.\n"
39 "Multiple ranges can be formatted by specifying\n"
40 "several -offset and -length pairs.\n"
41 "Can only be used with one input file."),
42 cl::cat(ClangFormatCategory));
43static cl::list<unsigned>
44 Lengths("length",
45 cl::desc("Format a range of this length (in bytes).\n"
46 "Multiple ranges can be formatted by specifying\n"
47 "several -offset and -length pairs.\n"
48 "When only a single -offset is specified without\n"
49 "-length, clang-format will format up to the end\n"
50 "of the file.\n"
51 "Can only be used with one input file."),
52 cl::cat(ClangFormatCategory));
alexfh6e701792013-07-18 22:54:56 +000053static cl::list<std::string>
54LineRanges("lines", cl::desc("<start line>:<end line> - format a range of\n"
55 "lines (both 1-based).\n"
56 "Multiple ranges can be formatted by specifying\n"
57 "several -lines arguments.\n"
58 "Can't be used with -offset and -length.\n"
59 "Can only be used with one input file."),
60 cl::cat(ClangFormatCategory));
alexfh725a9f72013-05-10 18:12:00 +000061static cl::opt<std::string>
62 Style("style",
revane4d118692013-09-30 13:31:48 +000063 cl::desc(clang::format::StyleOptionHelpDescription),
chandlerce6992fd2013-09-02 07:42:02 +000064 cl::init("file"), cl::cat(ClangFormatCategory));
alexfh7e0adcf2013-12-02 15:21:38 +000065static cl::opt<std::string>
66FallbackStyle("fallback-style",
alexfh07ea1ab2014-02-26 15:03:57 +000067 cl::desc("The name of the predefined style used as a\n"
68 "fallback in case clang-format is invoked with\n"
69 "-style=file, but can not find the .clang-format\n"
djasper077c43c2014-05-22 15:12:22 +000070 "file to use.\n"
71 "Use -fallback-style=none to skip formatting."),
alexfh7e0adcf2013-12-02 15:21:38 +000072 cl::init("LLVM"), cl::cat(ClangFormatCategory));
djasper05848282013-09-13 13:40:24 +000073
74static cl::opt<std::string>
djasper262cb332015-09-29 07:53:08 +000075AssumeFileName("assume-filename",
djasper05848282013-09-13 13:40:24 +000076 cl::desc("When reading from stdin, clang-format assumes this\n"
77 "filename to look for a style config file (with\n"
nico92818852014-11-10 16:14:54 +000078 "-style=file) and to determine the language."),
djasper44bf2ae2015-09-30 13:59:29 +000079 cl::init("<stdin>"), cl::cat(ClangFormatCategory));
djasper05848282013-09-13 13:40:24 +000080
alexfh725a9f72013-05-10 18:12:00 +000081static cl::opt<bool> Inplace("i",
82 cl::desc("Inplace edit <file>s, if specified."),
83 cl::cat(ClangFormatCategory));
84
85static cl::opt<bool> OutputXML("output-replacements-xml",
86 cl::desc("Output replacements as XML."),
87 cl::cat(ClangFormatCategory));
alexfh59883452013-05-10 11:56:10 +000088static cl::opt<bool>
89 DumpConfig("dump-config",
alexfh725a9f72013-05-10 18:12:00 +000090 cl::desc("Dump configuration options to stdout and exit.\n"
91 "Can be used with -style option."),
92 cl::cat(ClangFormatCategory));
djasperd0252b72013-05-21 12:21:39 +000093static cl::opt<unsigned>
94 Cursor("cursor",
alexfhb5b43022013-09-02 15:30:26 +000095 cl::desc("The position of the cursor when invoking\n"
96 "clang-format from an editor integration"),
djasperd0252b72013-05-21 12:21:39 +000097 cl::init(0), cl::cat(ClangFormatCategory));
djasper7f663602013-03-20 09:53:23 +000098
djasper71631c22015-11-16 12:38:56 +000099static cl::opt<bool> SortIncludes(
100 "sort-includes",
101 cl::desc("If set, overrides the include sorting behavior determined by the "
102 "SortIncludes style flag"),
103 cl::cat(ClangFormatCategory));
djasper578d2032015-09-23 08:30:47 +0000104
alexfh725a9f72013-05-10 18:12:00 +0000105static cl::list<std::string> FileNames(cl::Positional, cl::desc("[<file> ...]"),
106 cl::cat(ClangFormatCategory));
djasper7f663602013-03-20 09:53:23 +0000107
108namespace clang {
109namespace format {
110
dblaikieaa159c52014-06-27 17:40:03 +0000111static FileID createInMemoryFile(StringRef FileName, MemoryBuffer *Source,
d0k39bdfea2015-10-06 10:04:08 +0000112 SourceManager &Sources, FileManager &Files,
113 vfs::InMemoryFileSystem *MemFS) {
114 MemFS->addFileNoOwn(FileName, 0, Source);
115 return Sources.createFileID(Files.getFile(FileName), SourceLocation(),
116 SrcMgr::C_User);
djasper7f663602013-03-20 09:53:23 +0000117}
118
alexfh6e701792013-07-18 22:54:56 +0000119// Parses <start line>:<end line> input to a pair of line numbers.
alexfh4df43642013-04-24 12:46:44 +0000120// Returns true on error.
alexfh6e701792013-07-18 22:54:56 +0000121static bool parseLineRange(StringRef Input, unsigned &FromLine,
122 unsigned &ToLine) {
123 std::pair<StringRef, StringRef> LineRange = Input.split(':');
124 return LineRange.first.getAsInteger(0, FromLine) ||
125 LineRange.second.getAsInteger(0, ToLine);
126}
127
djasper578d2032015-09-23 08:30:47 +0000128static bool fillRanges(MemoryBuffer *Code,
129 std::vector<tooling::Range> &Ranges) {
d0k39bdfea2015-10-06 10:04:08 +0000130 IntrusiveRefCntPtr<vfs::InMemoryFileSystem> InMemoryFileSystem(
131 new vfs::InMemoryFileSystem);
132 FileManager Files(FileSystemOptions(), InMemoryFileSystem);
djasper578d2032015-09-23 08:30:47 +0000133 DiagnosticsEngine Diagnostics(
134 IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs),
135 new DiagnosticOptions);
136 SourceManager Sources(Diagnostics, Files);
d0k39bdfea2015-10-06 10:04:08 +0000137 FileID ID = createInMemoryFile("<irrelevant>", Code, Sources, Files,
138 InMemoryFileSystem.get());
alexfh6e701792013-07-18 22:54:56 +0000139 if (!LineRanges.empty()) {
140 if (!Offsets.empty() || !Lengths.empty()) {
djasper9e191b42015-11-23 08:36:35 +0000141 errs() << "error: cannot use -lines with -offset/-length\n";
alexfh6e701792013-07-18 22:54:56 +0000142 return true;
143 }
144
145 for (unsigned i = 0, e = LineRanges.size(); i < e; ++i) {
146 unsigned FromLine, ToLine;
147 if (parseLineRange(LineRanges[i], FromLine, ToLine)) {
djasper9e191b42015-11-23 08:36:35 +0000148 errs() << "error: invalid <start line>:<end line> pair\n";
alexfh6e701792013-07-18 22:54:56 +0000149 return true;
150 }
151 if (FromLine > ToLine) {
djasper9e191b42015-11-23 08:36:35 +0000152 errs() << "error: start line should be less than end line\n";
alexfh6e701792013-07-18 22:54:56 +0000153 return true;
154 }
155 SourceLocation Start = Sources.translateLineCol(ID, FromLine, 1);
156 SourceLocation End = Sources.translateLineCol(ID, ToLine, UINT_MAX);
157 if (Start.isInvalid() || End.isInvalid())
158 return true;
djasper578d2032015-09-23 08:30:47 +0000159 unsigned Offset = Sources.getFileOffset(Start);
160 unsigned Length = Sources.getFileOffset(End) - Offset;
161 Ranges.push_back(tooling::Range(Offset, Length));
alexfh6e701792013-07-18 22:54:56 +0000162 }
163 return false;
djasper7f663602013-03-20 09:53:23 +0000164 }
alexfh6e701792013-07-18 22:54:56 +0000165
djasper7f663602013-03-20 09:53:23 +0000166 if (Offsets.empty())
167 Offsets.push_back(0);
168 if (Offsets.size() != Lengths.size() &&
169 !(Offsets.size() == 1 && Lengths.empty())) {
djasper9e191b42015-11-23 08:36:35 +0000170 errs() << "error: number of -offset and -length arguments must match.\n";
alexfh4df43642013-04-24 12:46:44 +0000171 return true;
djasper7f663602013-03-20 09:53:23 +0000172 }
alexfh4df43642013-04-24 12:46:44 +0000173 for (unsigned i = 0, e = Offsets.size(); i != e; ++i) {
174 if (Offsets[i] >= Code->getBufferSize()) {
djasper9e191b42015-11-23 08:36:35 +0000175 errs() << "error: offset " << Offsets[i] << " is outside the file\n";
alexfh4df43642013-04-24 12:46:44 +0000176 return true;
177 }
djasper7f663602013-03-20 09:53:23 +0000178 SourceLocation Start =
179 Sources.getLocForStartOfFile(ID).getLocWithOffset(Offsets[i]);
180 SourceLocation End;
181 if (i < Lengths.size()) {
alexfh4df43642013-04-24 12:46:44 +0000182 if (Offsets[i] + Lengths[i] > Code->getBufferSize()) {
djasper9e191b42015-11-23 08:36:35 +0000183 errs() << "error: invalid length " << Lengths[i]
184 << ", offset + length (" << Offsets[i] + Lengths[i]
185 << ") is outside the file.\n";
alexfh4df43642013-04-24 12:46:44 +0000186 return true;
187 }
djasper7f663602013-03-20 09:53:23 +0000188 End = Start.getLocWithOffset(Lengths[i]);
189 } else {
190 End = Sources.getLocForEndOfFile(ID);
191 }
djasper578d2032015-09-23 08:30:47 +0000192 unsigned Offset = Sources.getFileOffset(Start);
193 unsigned Length = Sources.getFileOffset(End) - Offset;
194 Ranges.push_back(tooling::Range(Offset, Length));
djasper7f663602013-03-20 09:53:23 +0000195 }
alexfh6e701792013-07-18 22:54:56 +0000196 return false;
197}
198
klimek82392d72013-12-03 09:46:06 +0000199static void outputReplacementXML(StringRef Text) {
djasperc8a1a082015-10-15 18:39:31 +0000200 // FIXME: When we sort includes, we need to make sure the stream is correct
201 // utf-8.
klimek82392d72013-12-03 09:46:06 +0000202 size_t From = 0;
203 size_t Index;
djasperc8a1a082015-10-15 18:39:31 +0000204 while ((Index = Text.find_first_of("\n\r<&", From)) != StringRef::npos) {
djasper9e191b42015-11-23 08:36:35 +0000205 outs() << Text.substr(From, Index - From);
klimek82392d72013-12-03 09:46:06 +0000206 switch (Text[Index]) {
207 case '\n':
djasper9e191b42015-11-23 08:36:35 +0000208 outs() << "&#10;";
klimek82392d72013-12-03 09:46:06 +0000209 break;
210 case '\r':
djasper9e191b42015-11-23 08:36:35 +0000211 outs() << "&#13;";
klimek82392d72013-12-03 09:46:06 +0000212 break;
djasperc8a1a082015-10-15 18:39:31 +0000213 case '<':
djasper9e191b42015-11-23 08:36:35 +0000214 outs() << "&lt;";
djasperc8a1a082015-10-15 18:39:31 +0000215 break;
216 case '&':
djasper9e191b42015-11-23 08:36:35 +0000217 outs() << "&amp;";
djasperc8a1a082015-10-15 18:39:31 +0000218 break;
klimek82392d72013-12-03 09:46:06 +0000219 default:
220 llvm_unreachable("Unexpected character encountered!");
221 }
222 From = Index + 1;
223 }
djasper9e191b42015-11-23 08:36:35 +0000224 outs() << Text.substr(From);
klimek82392d72013-12-03 09:46:06 +0000225}
226
djasper578d2032015-09-23 08:30:47 +0000227static void outputReplacementsXML(const Replacements &Replaces) {
228 for (const auto &R : Replaces) {
229 outs() << "<replacement "
230 << "offset='" << R.getOffset() << "' "
231 << "length='" << R.getLength() << "'>";
232 outputReplacementXML(R.getReplacementText());
233 outs() << "</replacement>\n";
234 }
235}
236
alexfh6e701792013-07-18 22:54:56 +0000237// Returns true on error.
voida14558f2013-11-09 00:23:58 +0000238static bool format(StringRef FileName) {
rafael54c71a82014-07-06 17:43:24 +0000239 ErrorOr<std::unique_ptr<MemoryBuffer>> CodeOrErr =
240 MemoryBuffer::getFileOrSTDIN(FileName);
241 if (std::error_code EC = CodeOrErr.getError()) {
djasper9e191b42015-11-23 08:36:35 +0000242 errs() << EC.message() << "\n";
alexfh6e701792013-07-18 22:54:56 +0000243 return true;
244 }
rafael54c71a82014-07-06 17:43:24 +0000245 std::unique_ptr<llvm::MemoryBuffer> Code = std::move(CodeOrErr.get());
alexfh6e701792013-07-18 22:54:56 +0000246 if (Code->getBufferSize() == 0)
djasper60dad2e2013-10-08 15:54:36 +0000247 return false; // Empty files are formatted correctly.
djasper578d2032015-09-23 08:30:47 +0000248 std::vector<tooling::Range> Ranges;
249 if (fillRanges(Code.get(), Ranges))
alexfh6e701792013-07-18 22:54:56 +0000250 return true;
djasper262cb332015-09-29 07:53:08 +0000251 StringRef AssumedFileName = (FileName == "-") ? AssumeFileName : FileName;
amaioranoa7d62362017-01-17 00:12:27 +0000252
253 llvm::Expected<FormatStyle> FormatStyle =
djasper4be7a6c2016-12-12 12:42:29 +0000254 getStyle(Style, AssumedFileName, FallbackStyle, Code->getBuffer());
amaioranoa7d62362017-01-17 00:12:27 +0000255 if (!FormatStyle) {
256 llvm::errs() << llvm::toString(FormatStyle.takeError()) << "\n";
257 return true;
258 }
mprobstf9dd41b2017-01-27 09:09:11 +0000259
djasper71631c22015-11-16 12:38:56 +0000260 if (SortIncludes.getNumOccurrences() != 0)
amaioranoa7d62362017-01-17 00:12:27 +0000261 FormatStyle->SortIncludes = SortIncludes;
djasper9e191b42015-11-23 08:36:35 +0000262 unsigned CursorPosition = Cursor;
amaioranoa7d62362017-01-17 00:12:27 +0000263 Replacements Replaces = sortIncludes(*FormatStyle, Code->getBuffer(), Ranges,
djasper9e191b42015-11-23 08:36:35 +0000264 AssumedFileName, &CursorPosition);
ioeric2b036d32016-07-11 13:53:12 +0000265 auto ChangedCode = tooling::applyAllReplacements(Code->getBuffer(), Replaces);
266 if (!ChangedCode) {
267 llvm::errs() << llvm::toString(ChangedCode.takeError()) << "\n";
268 return true;
269 }
ioeric51590652016-08-10 09:32:23 +0000270 // Get new affected ranges after sorting `#includes`.
271 Ranges = tooling::calculateRangesAfterReplacements(Replaces, Ranges);
djasper0c6c9472015-05-10 07:47:19 +0000272 bool IncompleteFormat = false;
amaioranoa7d62362017-01-17 00:12:27 +0000273 Replacements FormatChanges = reformat(*FormatStyle, *ChangedCode, Ranges,
djasper9e191b42015-11-23 08:36:35 +0000274 AssumedFileName, &IncompleteFormat);
ioeric531dffd2016-08-01 10:16:37 +0000275 Replaces = Replaces.merge(FormatChanges);
djasper7f663602013-03-20 09:53:23 +0000276 if (OutputXML) {
djasper9e191b42015-11-23 08:36:35 +0000277 outs() << "<?xml version='1.0'?>\n<replacements "
278 "xml:space='preserve' incomplete_format='"
279 << (IncompleteFormat ? "true" : "false") << "'>\n";
klimekbf977882015-01-09 10:03:47 +0000280 if (Cursor.getNumOccurrences() != 0)
djasper9e191b42015-11-23 08:36:35 +0000281 outs() << "<cursor>"
ioeric531dffd2016-08-01 10:16:37 +0000282 << FormatChanges.getShiftedCodePosition(CursorPosition)
djasper9e191b42015-11-23 08:36:35 +0000283 << "</cursor>\n";
djasper0c6c9472015-05-10 07:47:19 +0000284
ioeric531dffd2016-08-01 10:16:37 +0000285 outputReplacementsXML(Replaces);
djasper9e191b42015-11-23 08:36:35 +0000286 outs() << "</replacements>\n";
djasper7f663602013-03-20 09:53:23 +0000287 } else {
d0k39bdfea2015-10-06 10:04:08 +0000288 IntrusiveRefCntPtr<vfs::InMemoryFileSystem> InMemoryFileSystem(
289 new vfs::InMemoryFileSystem);
290 FileManager Files(FileSystemOptions(), InMemoryFileSystem);
djasper44bf2ae2015-09-30 13:59:29 +0000291 DiagnosticsEngine Diagnostics(
292 IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs),
293 new DiagnosticOptions);
294 SourceManager Sources(Diagnostics, Files);
d0k39bdfea2015-10-06 10:04:08 +0000295 FileID ID = createInMemoryFile(AssumedFileName, Code.get(), Sources, Files,
296 InMemoryFileSystem.get());
djasper44bf2ae2015-09-30 13:59:29 +0000297 Rewriter Rewrite(Sources, LangOptions());
298 tooling::applyAllReplacements(Replaces, Rewrite);
djasper7f663602013-03-20 09:53:23 +0000299 if (Inplace) {
djasper529feb12015-05-06 11:56:54 +0000300 if (FileName == "-")
djasper9e191b42015-11-23 08:36:35 +0000301 errs() << "error: cannot use -i when reading from stdin.\n";
djasper44bf2ae2015-09-30 13:59:29 +0000302 else if (Rewrite.overwriteChangedFiles())
303 return true;
djasper7f663602013-03-20 09:53:23 +0000304 } else {
djasper898b4f72013-05-21 14:21:46 +0000305 if (Cursor.getNumOccurrences() != 0)
grosser7e070d52015-05-08 21:34:09 +0000306 outs() << "{ \"Cursor\": "
ioeric531dffd2016-08-01 10:16:37 +0000307 << FormatChanges.getShiftedCodePosition(CursorPosition)
djasper0c6c9472015-05-10 07:47:19 +0000308 << ", \"IncompleteFormat\": "
309 << (IncompleteFormat ? "true" : "false") << " }\n";
djasper44bf2ae2015-09-30 13:59:29 +0000310 Rewrite.getEditBuffer(ID).write(outs());
djasper7f663602013-03-20 09:53:23 +0000311 }
312 }
alexfh4df43642013-04-24 12:46:44 +0000313 return false;
djasper7f663602013-03-20 09:53:23 +0000314}
315
316} // namespace format
317} // namespace clang
318
nico436d02f2014-01-07 16:27:35 +0000319static void PrintVersion() {
320 raw_ostream &OS = outs();
321 OS << clang::getClangToolFullVersion("clang-format") << '\n';
322}
323
djasper7f663602013-03-20 09:53:23 +0000324int main(int argc, const char **argv) {
rsmith54e6c052016-06-09 00:53:41 +0000325 llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
alexfh725a9f72013-05-10 18:12:00 +0000326
cbienemanc9f3db62015-01-21 23:26:11 +0000327 cl::HideUnrelatedOptions(ClangFormatCategory);
alexfh725a9f72013-05-10 18:12:00 +0000328
nico436d02f2014-01-07 16:27:35 +0000329 cl::SetVersionPrinter(PrintVersion);
djasper7f663602013-03-20 09:53:23 +0000330 cl::ParseCommandLineOptions(
331 argc, argv,
nico636f8552015-10-19 01:03:19 +0000332 "A tool to format C/C++/Java/JavaScript/Objective-C/Protobuf code.\n\n"
djasper7f663602013-03-20 09:53:23 +0000333 "If no arguments are specified, it formats the code from standard input\n"
334 "and writes the result to the standard output.\n"
alexfhb5b43022013-09-02 15:30:26 +0000335 "If <file>s are given, it reformats the files. If -i is specified\n"
336 "together with <file>s, the files are edited in-place. Otherwise, the\n"
alexfh4df43642013-04-24 12:46:44 +0000337 "result is written to the standard output.\n");
338
djasper7f663602013-03-20 09:53:23 +0000339 if (Help)
340 cl::PrintHelpMessage();
alexfh4df43642013-04-24 12:46:44 +0000341
alexfh59883452013-05-10 11:56:10 +0000342 if (DumpConfig) {
amaioranoa7d62362017-01-17 00:12:27 +0000343 llvm::Expected<clang::format::FormatStyle> FormatStyle =
344 clang::format::getStyle(
djasper262cb332015-09-29 07:53:08 +0000345 Style, FileNames.empty() ? AssumeFileName : FileNames[0],
amaioranoa7d62362017-01-17 00:12:27 +0000346 FallbackStyle);
347 if (!FormatStyle) {
348 llvm::errs() << llvm::toString(FormatStyle.takeError()) << "\n";
349 return 1;
350 }
351 std::string Config = clang::format::configurationAsText(*FormatStyle);
djasper9e191b42015-11-23 08:36:35 +0000352 outs() << Config << "\n";
alexfh59883452013-05-10 11:56:10 +0000353 return 0;
354 }
355
alexfh4df43642013-04-24 12:46:44 +0000356 bool Error = false;
357 switch (FileNames.size()) {
358 case 0:
359 Error = clang::format::format("-");
360 break;
361 case 1:
362 Error = clang::format::format(FileNames[0]);
363 break;
364 default:
alexfh6e701792013-07-18 22:54:56 +0000365 if (!Offsets.empty() || !Lengths.empty() || !LineRanges.empty()) {
djasper9e191b42015-11-23 08:36:35 +0000366 errs() << "error: -offset, -length and -lines can only be used for "
367 "single file.\n";
alexfh4df43642013-04-24 12:46:44 +0000368 return 1;
369 }
370 for (unsigned i = 0; i < FileNames.size(); ++i)
371 Error |= clang::format::format(FileNames[i]);
372 break;
373 }
374 return Error ? 1 : 0;
djasper7f663602013-03-20 09:53:23 +0000375}
djasper44bf2ae2015-09-30 13:59:29 +0000376