Mercurial > hg4j
annotate src/org/tmatesoft/hg/internal/Filter.java @ 113:67ae317408c9
Filter implementation for newline translation
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 02 Feb 2011 21:19:02 +0100 |
parents | d488c7638b87 |
children | 46291ec605a0 |
rev | line source |
---|---|
112
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
1 /* |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2011 TMate Software Ltd |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
3 * |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
4 * This program is free software; you can redistribute it and/or modify |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
6 * the Free Software Foundation; version 2 of the License. |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
7 * |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
8 * This program is distributed in the hope that it will be useful, |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
11 * GNU General Public License for more details. |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
12 * |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
13 * For information on how to redistribute this software under |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
14 * the terms of a license other than GNU General Public License |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
15 * contact TMate Software at support@svnkit.com |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
16 */ |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
17 package org.tmatesoft.hg.internal; |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
18 |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
19 import java.nio.ByteBuffer; |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
20 |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
21 import org.tmatesoft.hg.core.Path; |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
22 import org.tmatesoft.hg.repo.HgRepository; |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
23 |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
24 /** |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
25 * |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
26 * @author Artem Tikhomirov |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
27 * @author TMate Software Ltd. |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
28 */ |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
29 public interface Filter { |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
30 |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
31 ByteBuffer filter(ByteBuffer src); |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
32 |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
33 interface Factory { |
113
67ae317408c9
Filter implementation for newline translation
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
112
diff
changeset
|
34 Filter create(HgRepository hgRepo, Path path, Options opts); |
67ae317408c9
Filter implementation for newline translation
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
112
diff
changeset
|
35 } |
67ae317408c9
Filter implementation for newline translation
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
112
diff
changeset
|
36 |
67ae317408c9
Filter implementation for newline translation
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
112
diff
changeset
|
37 enum Direction { |
67ae317408c9
Filter implementation for newline translation
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
112
diff
changeset
|
38 FromRepo, ToRepo |
67ae317408c9
Filter implementation for newline translation
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
112
diff
changeset
|
39 } |
67ae317408c9
Filter implementation for newline translation
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
112
diff
changeset
|
40 |
67ae317408c9
Filter implementation for newline translation
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
112
diff
changeset
|
41 abstract class Options { |
67ae317408c9
Filter implementation for newline translation
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
112
diff
changeset
|
42 abstract Direction getDirection(); |
112
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
43 } |
d488c7638b87
Prototype Filter support with keyword filter as a playground
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
44 } |