Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fea0896

Browse files
author
Vincent Cantin
committed
Added some classes to represent a file-based content location.
1 parent a87a690 commit fea0896

File tree

4 files changed

+89
-0
lines changed

4 files changed

+89
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.lemoulinstudio.sdiff.content;
2+
3+
/**
4+
* A reference to a content.
5+
*/
6+
public class ContentReference {
7+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.lemoulinstudio.sdiff.content;
2+
3+
import com.lemoulinstudio.sdiff.repo.Repository;
4+
import java.io.File;
5+
6+
/**
7+
* A reference to a content persisted in a file.
8+
*/
9+
public class FileContentReference extends ContentReference {
10+
11+
/**
12+
* The repository the content belongs to, if it exists.
13+
*/
14+
public Repository repository;
15+
16+
/**
17+
* The file containing the content.
18+
*/
19+
public File file;
20+
21+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.lemoulinstudio.sdiff.diffelt;
2+
3+
import com.lemoulinstudio.sdiff.content.FileContentReference;
4+
5+
/**
6+
* A location inside a content persisted in a file.
7+
*
8+
* Here, the content is treated as pure binary data,
9+
* each location is like an index in a byte array.
10+
*/
11+
public class FileContentLocation implements ContentLocation {
12+
13+
/**
14+
* A reference to a content which is in a file.
15+
*/
16+
public FileContentReference file;
17+
18+
/**
19+
* A location inside a file.
20+
*
21+
* It points to the position of a byte.
22+
*/
23+
public long index;
24+
25+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.lemoulinstudio.sdiff.repo;
2+
3+
import java.io.File;
4+
5+
/**
6+
* A repository where some content is stored.
7+
*/
8+
public class Repository {
9+
10+
// A few predefined types of repository.
11+
public static final String GIT_TYPE = "git";
12+
public static final String MERCURIAL_TYPE = "hg";
13+
public static final String SVN_TYPE = "svn";
14+
public static final String CVS_TYPE = "cvs";
15+
16+
/**
17+
* The type of repository.
18+
*/
19+
public String type;
20+
21+
/**
22+
* The base directory of this repository, if it exists.
23+
*/
24+
public File baseDirectory;
25+
26+
/**
27+
* The name of this repository, if it exists.
28+
*/
29+
public String name;
30+
31+
/**
32+
* The identifier of this repository, if it exists.
33+
*/
34+
public String identifier;
35+
36+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /